CocoaPods trunk is moving to be read-only. Read more on the blog, there are 3 months to go.

AdaptiveSidebarViewController 0.0.2

AdaptiveSidebarViewController 0.0.2

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.



  • By
  • Mathias Köhnke

AdaptiveSidebarViewController

AdaptiveSidebarViewController is a simple container which can adaptively display a viewcontroller in a sidebar (regular environment) or pushed on the navigation stack (compact environment).

 

Installation

Usage

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

License

AdaptiveSidebarViewController is available under the MIT license. See the LICENSE file for more info.