BNSlidingViewController is a Swift controller mimics the player overlay in iTunes iOS app. Created by Ben Nagar.
- Xcode 7.2
- iOS 7.0+
Just add BNSlidingViewController.swift to your project.
- Create your
SlidingPanelViewController
and make it implementSlidable
protocol
collapsedView
need to be your ViewController's viewexpandedView
need to be external view, NOT subview of you collapsedView (you can see easy way to do it in the demo project)
- Create your
MainViewController
subclassingBNSlidingViewController
- in
viewDidLoad()
get your SlidingPanel and pass it tosetup()
- you can override this method in your
MainViewController
to handle state changes
override func didChangeState(newState: SliderState) {
super.didChangeState(newState)
//change you view according to the new state
}
BNSlidingViewController is available under the MIT license. See the LICENSE file for more info.
Follow on Twitter ✨CodeLetter ✎ ✨