KYDrawerController is a side drawer navigation container view controller similar to Android.
- Storyboard Support
- AutoLayout Support
KYDrawerController is available on CocoaPods.
Add the following to your Podfile:
pod'KYDrawerController'Just add the Classes folder to your project.
(see sample Xcode project in /Example)
import UIKit
import KYDrawerController
@UIApplicationMainclassAppDelegate:UIResponder,UIApplicationDelegate{varwindow:UIWindow?func application(application:UIApplication, didFinishLaunchingWithOptions launchOptions:[NSObject:AnyObject]?)->Bool{
// Override point for customization after application launch.
letmainViewController=MainViewController()letdrawerViewController=DrawerViewController()letdrawerController=KYDrawerController()
drawerController.mainViewController =UINavigationController(
rootViewController: mainViewController
)
drawerController.drawerViewController = drawerViewController
/* Customize
drawerController.drawerDirection = .Right
drawerController.drawerWidth = 200
*/
window =UIWindow(frame:UIScreen.mainScreen().bounds)
window?.rootViewController = drawerController
window?.makeKeyAndVisible()returntrue}- Set the
KYDrawerControllerto Custom Class of Initial ViewController.
- Connects the
KYEmbedDrawerControllerSegueto DrawerViewController fromKYDrawerController
- Connects the
KYEmbedMainControllerSegueto DrawerViewController fromKYDrawerController
- Set the SegueIdentifiers to inspector of
KYDrawerController.
func setDrawerState(state:DrawerState, animated:Bool)optionalfunc drawerController(drawerController:KYDrawerController, stateChanged state:KYDrawerController.DrawerState)https://github.com/AustinChou/KYDrawerController-ObjC
This code is distributed under the terms and conditions of the MIT license.






