TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by MacTeo.
User resizable split view to accomodate two view controllers for iOS.
Resizable split view that accomodates two view controllers for iOS.
Heavily inspired by the Swift Playgrounds app for iPad, SplitKit gives you the ability to easily present two UIView
s side by side (or stacked one on top of the other) baked by different UIViewControllers
. Everything is implemented in a single .swift file to easily drop it in in existing projects. CocoaPods, Carthage and plain Dynamic Framework are supported as well for your convenience. The end user has the ability to resize the views just dragging the separator like each macOS counterpart, when the drag is performed a convenient handle appears to highlight the resizing operation. If the separator is really close to one of the edges, it will snap to it with an enjoyable animation and the handle won't disappear to highlight the hidden view position.
topLayoutGuide
and bottomLayoutGuide
through iOS 11 and the new safeAreaLayoutGuide
.Add the SplitKit Xcode project to your own. Then add the SplitKit
framework as desired to the embedded binaries of your app's target.
In this repository you can find a sample project with few lines of code in the ViewController
class for a jumpstart.
Sample code is written in Objective-C, if you find an incompatibility please open an issue. Swift apps are obviously supported too.
Import SplitKit modules into your Swift class
import SplitKit
or if you are writing in Objective-C
@import SplitKit;
Keep in mind the you have to let the project generate the Bridging Header otherwise the integration may fail.
SPKSplitViewController *splitController = [[SPKSplitViewController alloc] init];
[self addChildViewController:splitController];
splitController.view.frame = self.view.bounds;
splitController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:splitController.view];
[splitController didMoveToParentViewController:self];
splitController.arrangement = SPKArrangementHorizontal;
Customize the appearance as desired. You can use SplitKit directly from a Storyboard.
Enjoy.
SplitKit is released under the MIT license. See LICENSE for details.