TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2015 |
SPMSupports SPM | ✗ |
Maintained by Mathias Koehnke, cg, Tino Rachui, Mathias Köhnke, Michael Kamphausen, Nico Schümann, Heiko Wichmann, Stephan Lerner, Famara Kassama.
AdaptiveSidebarViewController is a simple container which can adaptively display a viewcontroller in a sidebar (regular environment) or pushed on the navigation stack (compact environment).
Make a subclass of AdaptiveSidebarViewController and specify the main/side viewcontrollers:
override func viewDidLoad() {
let mainVC = storyboard.instantiateViewControllerWithIdentifier("mainVC")
mainViewController = mainVC
let detailVC : storyboard.instantiateViewControllerWithIdentifier("detailVC")
sideViewController = detailVC
super.viewDidLoad()
}
In order to show/hide the sidebar, you use:
func showSideView(animated: Bool) -> Void
func hideSideView(animated: Bool) -> Void
Apart from that, one can modify the sidebar width:
sideViewWidth = 320
AdaptiveSidebarViewController is available under the MIT license. See the LICENSE file for more info.