Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

A simple container which can adaptively display an iOS viewcontroller in a sidebar

License

Notifications You must be signed in to change notification settings

apploft/AdaptiveSidebarViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Install via cocoapods by adding this to your Podfile:

pod "AdaptiveSidebarViewController"

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.

About

A simple container which can adaptively display an iOS viewcontroller in a sidebar

Resources

License

Stars

Watchers

Forks

Packages

No packages published