Created
October 31, 2019 17:27
-
-
Save jbarros35/b57cfe037227eb948c0ad6c80c1aefee to your computer and use it in GitHub Desktop.
setup DrawerController with a UITabBar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DispatchQueue.main.async { | |
// Init Drawer | |
let appDelegate = UIApplication.shared.delegate as! AppDelegate | |
let storyBoard = UIStoryboard.init(name: "Main", bundle: Bundle.main) | |
let navVC = storyBoard.instantiateViewController(withIdentifier: "MainController") as! MyTabBarController | |
navVC.loggedAlready = true | |
// is the main controller for the drawer. | |
let drawerVC = storyBoard.instantiateViewController(withIdentifier: "DrawerVC") | |
// is the drawer, and the drawer needs a main controller | |
appDelegate.drawerController.mainViewController = navVC | |
appDelegate.drawerController.drawerViewController = drawerVC | |
appDelegate.drawerController.drawerDirection = .right | |
appDelegate.window?.rootViewController = appDelegate.drawerController | |
appDelegate.window?.makeKeyAndVisible() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment