Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save glennposadas/3f85859eab339d630e844bb7b081bd2c to your computer and use it in GitHub Desktop.
Save glennposadas/3f85859eab339d630e844bb7b081bd2c to your computer and use it in GitHub Desktop.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Get view controllers from storyboard
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let rootViewController = storyboard.instantiateViewControllerWithIdentifier("RootViewController") as! RootViewController
let sideViewController = storyboard.instantiateViewControllerWithIdentifier("SideViewController") as! SideViewController
// Add a navigation controller to our main screen
var rootNavCon = RootNavigationController(rootViewController: rootViewController)
rootNavCon = storyboard.instantiateViewControllerWithIdentifier("RootNavigationController") as! RootNavigationController
let sideNavigationController = SideNavigationController(rootViewController: rootNavCon, leftViewController: sideViewController)
// modifying the side menu a bit, prevent a bug.
sideNavigationController.enabledLeftTapGesture = true
sideNavigationController.enabledLeftPanGesture = true
sideNavigationController.enableHideStatusbar = false
// Configure the window with the SideNavigationController as the root view controller
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = sideNavigationController
window?.makeKeyAndVisible()
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment