0
Hello, take it easy on me 'cause I’m a complete beginner.
I’m trying to change the root of an application I’m trying to do. It even worked when I mentioned window!.rootViewController = centerContainer
But when I do, the menu stops working. Can someone give me a help? I believe all my complication is in Appdelegate.
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var centerContainer: MMDrawerController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
_ = self.window!.rootViewController
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let centerViewController = mainStoryboard.instantiateViewControllerWithIdentifier("homeViewController") as! homeViewController
let leftViewController = mainStoryboard.instantiateViewControllerWithIdentifier("LeftSideViewController") as! LeftSideViewController
let rightViewController = mainStoryboard.instantiateViewControllerWithIdentifier("RightSideViewController") as! RightSideViewController
let leftSideNav = UINavigationController(rootViewController: leftViewController)
let centerNav = UINavigationController(rootViewController: centerViewController)
let rightNav = UINavigationController(rootViewController: rightViewController)
centerContainer = MMDrawerController(centerViewController: centerNav, leftDrawerViewController: leftSideNav,rightDrawerViewController:rightNav)
centerContainer!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.PanningCenterView;
centerContainer!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningCenterView;
window!.rootViewController = centerContainer
window!.makeKeyAndVisible()
return true
}
I have to create 1 Viewcontroller and a Cocoatouchclass file named Signinvcviewcontroller right? Ai place the Class in Viewcontroller and Storyboard ID(Signinvcviewcontroller). E place the code in Appdelegate. That’s it?
– Leu Oliveira
That’s right, buddy.
– JdsMedeirosBR
Return me a SIGABRT in the 'class Appdelegate: Uiresponder, Uiapplicationdelegate {'
– Leu Oliveira
I’m not treating two different Viewcontroller as root?
– Leu Oliveira
try this... http://stackoverflow.com/questions/24316966/how-to-set-the-rootviewcontroller-with-swift-ios-7
– JdsMedeirosBR
I can’t, I’m sure I’m calling two Roots. ( I don’t know how to work these three lines out of root. 

' let leftSideNav = UINavigationController(rootViewController: leftViewController)
 let centerNav = UINavigationController(rootViewController: centerViewController)
 let rightNav = UINavigationController(rootViewController: rightViewController)'
– Leu Oliveira
guy has no mistake, it is only follow this Tuto, this code dah right... just pay attention to the code and the name of your views.
– JdsMedeirosBR
Setting root is no problem, the problem is changing root using Mmdrawercontroller. I’m googlando here. But it’s awful.
– Leu Oliveira
Let’s go continue this discussion in chat.
– Leu Oliveira
I got it, thanks!
– Leu Oliveira