Skip to content

Commit

Permalink
Added snapping, documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
twodayslate committed Sep 4, 2019
1 parent 2df5514 commit de46df0
Show file tree
Hide file tree
Showing 52 changed files with 8,965 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Resizable Split View, inspired by [Apple's Split View](https://support.apple.com/en-us/HT207582#split) for iPadOS and [SplitKit](https://github.com/macteo/SplitKit)

<p align="center">
<img src="./images/vertical.png" width="25%" alt="Vertical"/> <img src="./images/horizontal.png" width="25%" alt="Horizontal"/>
<img src="https://github.com/twodayslate/SplitView/raw/master/images/vertical.png" width="25%" alt="Vertical"/> <img src="https://github.com/twodayslate/SplitView/raw/master/images/horizontal.png" width="25%" alt="Horizontal"/>
</p>

## Requirements
Expand Down Expand Up @@ -32,6 +32,6 @@ mySplitView.addView(myFirstView)
mySplitView.addView(mySecondView)
```

There are certain customizations available.
There are certain customizations available including minimum sizing and snapping.

Be sure to checkout the [example App](./app).
Be sure to checkout the [example App](https://github.com/twodayslate/SplitView/tree/master/app).
2 changes: 1 addition & 1 deletion SplitView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SplitView'
s.version = '1.1.0'
s.version = '1.2.0'
s.summary = 'A resizable Split View'
s.swift_versions = ['5.0']

Expand Down
13 changes: 12 additions & 1 deletion app/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class ViewController: UIViewController {
stack.addArrangedSubview(toolbar)

toolbar.items = [
UIBarButtonItem(title: "Rotate", style: .plain, target: self, action: #selector(rotate(_:)))
UIBarButtonItem(title: "Rotate", style: .plain, target: self, action: #selector(rotate(_:))),
UIBarButtonItem(title: "Toggle Snapping", style: .plain, target: self, action: #selector(toggleSnap(_:)))
]

splitView = SplitView()
Expand Down Expand Up @@ -68,4 +69,14 @@ class ViewController: UIViewController {
self.splitView.axis = .horizontal
}
}

@objc func toggleSnap(_ sender: UIBarButtonItem) {
if splitView.snap.isEmpty {
sender.title = "Turn off Snapping"
splitView.snap.append(SplitViewSnapBehavior.quarter)
} else {
sender.title = "Turn on Snapping"
splitView.snap.removeAll()
}
}
}
184 changes: 184 additions & 0 deletions docs/Classes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Classes Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>

<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>

<a name="//apple_ref/swift/Section/Classes" class="dashAnchor"></a>

<a title="Classes Reference"></a>

<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
SplitView &#39;1.1.0&#39; Docs
</a>

</p>

<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>

<p class="header-col header-col--secondary">
<a class="header-link" href="https://github.com/twodayslate/SplitView">
<img class="header-icon" src="img/gh.png"/>
View on GitHub
</a>
</p>

<p class="header-col header-col--secondary">
<a class="header-link" href="dash-feed://https%3A%2F%2Ftwodayslate%2Egithub%2Eio%2FSplitView%2Freference%2Fdocsets%2FSplitView%2Exml">
<img class="header-icon" src="img/dash.png"/>
Install in Dash
</a>
</p>
</header>

<p class="breadcrumbs">
<a class="breadcrumb" href="index.html">SplitView Reference</a>
<img class="carat" src="img/carat.png" />
Classes Reference
</p>

<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SplitView.html">SplitView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/SplitViewHandle.html">SplitViewHandle</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/SplitViewSnapBehavior.html">SplitViewSnapBehavior</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/SplitSupportingView.html">SplitSupportingView</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs.html#/s:9SplitView0aB9SnapPointV">SplitViewSnapPoint</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">

<section class="section">
<div class="section-content">
<h1>Classes</h1>
<p>The following classes are available globally.</p>

</div>
</section>

<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/c:@M@SplitView@objc(cs)SplitView"></a>
<a name="//apple_ref/swift/Class/SplitView" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SplitView@objc(cs)SplitView">SplitView</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>

<a href="Classes/SplitView.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">SplitView</span> <span class="p">:</span> <span class="kt">UIView</span></code></pre>

</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/twodayslate/SplitView/tree/master/splitview/SplitView.swift#L12-L264">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/c:@M@SplitView@objc(cs)SplitViewHandle"></a>
<a name="//apple_ref/swift/Class/SplitViewHandle" class="dashAnchor"></a>
<a class="token" href="#/c:@M@SplitView@objc(cs)SplitViewHandle">SplitViewHandle</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>

<a href="Classes/SplitViewHandle.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">open</span> <span class="kd">class</span> <span class="kt">SplitViewHandle</span> <span class="p">:</span> <span class="kt">UIView</span></code></pre>

</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/twodayslate/SplitView/tree/master/splitview/SplitViewHandle.swift#L4-L110">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>

</article>
</div>
<section class="footer">
<p><a class="link" href="https://github.com/twodayslate/SplitView/blob/master/LICENSE" target="_blank" rel="external">© 2019 SplitView</a>. (Last updated: 2019-09-03)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.10.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>
Loading

0 comments on commit de46df0

Please sign in to comment.