Skip to content

Instantly share code, notes, and snippets.

@joelmarquez90
Last active December 28, 2017 14:53
Show Gist options
  • Save joelmarquez90/f7539875bf63ec3de7c6c9db50ba7fa5 to your computer and use it in GitHub Desktop.
Save joelmarquez90/f7539875bf63ec3de7c6c9db50ba7fa5 to your computer and use it in GitHub Desktop.
public func start() {
// We create the TabBarController and assign it to a property so we can have control of it
// The tabs setup is inside the viewDidLoad of it
tabBarController = TabBarController()
// At this moment I created a BaseViewController where other VCs can inherit from and have useful methods
tournamentsVC = BaseViewController()
// We create a navigation controller so the drawer will have a navigation bar
tournamentsNC = UINavigationController(rootViewController: tournamentsVC!)
// We create the slide drawer with the classes created above
drawerController = MMDrawerController(center: tabBarController!, leftDrawerViewController: tournamentsNC!)
drawerController?.openDrawerGestureModeMask = .all
drawerController?.closeDrawerGestureModeMask = .all
drawerController?.setDrawerVisualStateBlock(MMDrawerVisualState.parallaxVisualStateBlock(withParallaxFactor: 2))
// Finally we create the window with the same frame than the main screen and assign the drawerController to the rootViewController
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = drawerController!
window?.makeKeyAndVisible()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment