I am Using MMDrawerController in my Project. I followed this http://swiftdeveloperblog.com/left-side-menu-navigation-drawer-example-with-swift/ to set the MMDrawerController within my App. I used the same code in the tutorial in AppDelegate.swift file.
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var homeController : MMDrawerController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
//NSNotificationCenter.defaultCenter().addObserver(self, selector: "detectRotation", name: UIDeviceOrientationDidChangeNotification, object: nil)
_ = self.window!.rootViewController
let mainStoryBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let homeViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("HomeViewController") as! HomeViewController
let menuViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("MenuViewController") as! MenuViewController
let leftSideNavigation = UINavigationController(rootViewController: menuViewController);
let homeNavigation = UINavigationController(rootViewController: homeViewController);
homeController = MMDrawerController(centerViewController: homeNavigation, leftDrawerViewController: leftSideNavigation);
homeController!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.PanningCenterView
homeController!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningCenterView
homeController?.setMaximumLeftDrawerWidth(UIScreen.mainScreen().bounds.width, animated: true, completion: nil)
window!.rootViewController = homeController // current Entry point
window!.makeKeyAndVisible();
return true
}
}
after setting the code when i run the app , the entry point of the app has changed to homeController (Home Screen that should appear only a user log's in or creates a new account)
I removed these lines from my AppDelegate File
window!.rootViewController = homeController // current Entry point
window!.makeKeyAndVisible();
So the app starts from the entry point that i have Set ie: the Login Page. But what happens now is the Drawer is Not showing on Pressing the Menu button (Hamburger). So what do i need to change/Add in-order to achieve my entry point and to make my drawer working ?