KZSideDrawerController is a side drawer controller for iOS written in Swift.
To run the example project, clone the repo, and run pod install
from the Example directory first.
let sideDrawerController = KZSideDrawerController()
sideDrawerController.centerViewController = UIViewController()
sideDrawerController.leftViewController = UIViewController()
sideDrawerController.rightViewController = UIViewController()
sideDrawerController.openDrawer(side: .Left, animated: true, completion: nil)
sideDrawerController.closeDrawer(side: .Right, animated: true, completion: nil)
extension ViewController: KZSideDrawerControllerDelegate {
func sideDrawerController(sideDrawerController: KZSideDrawerController, willOpenViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
func sideDrawerController(sideDrawerController: KZSideDrawerController, didOpenViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
func sideDrawerController(sideDrawerController: KZSideDrawerController, willCloseViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
func sideDrawerController(sideDrawerController: KZSideDrawerController, didCloseViewController viewController: UIViewController, forSide side: KZDrawerSide, animated: Bool) {}
}
leftDrawerWidth
- The width of the left drawer. Defaults to 280.0.
rightDrawerWidth
- The width of the right drawer. Defaults to 280.0.
shadowOpacity
- The opacity of the drawer's shadow. Defaults to 0.5.
shadowRadius
- The blur radius of the drawer's shadow. Defaults to 3.0.
shadowOffset
- The offset of the drawer's shadow. Defaults to (0.0, 0.0).
shadowColor
- The color of the drawer's shadow. Defaults to opaque black color.
dimmingColor
- The color used to dim the center view while the drawer is open. Defaults to black color with alpha 0.3.
- iOS 7.0+
- Xcode 7+
KZSideDrawerController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "KZSideDrawerController"
Satoshi Matsumoto, kaorimatz@gmail.com
KZSideDrawerController is available under the MIT license. See the LICENSE file for more info.