我正在使用MMDraweController。它工作完美。我有rootViewController的問題。當應用程序啓動時,它加載loginViewController。所以我不想要側欄菜單那裏(loginViewController沒有任何導航控制器)。我的問題是使用下面的代碼應用程序從viewController開始,而不是loginViewController。我怎樣才能使用登錄頁面沒有側欄菜單和viewController邊欄?swift MMDrawerController:想改變rootViewController
var rootViewController = self.window!.rootViewController
let mainStoryBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
var centerViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("ViewController") as ViewController
//var rootViewController = centerViewController
var leftViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("SideBarMenuViewController") as SideBarMenuViewController
var leftSideNav = UINavigationController(rootViewController: leftViewController)
var centerSideNav = UINavigationController(rootViewController: centerViewController)
centerContainer = MMDrawerController(centerViewController: centerSideNav, leftDrawerViewController: leftSideNav)
centerContainer!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.PanningCenterView
centerContainer!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.PanningCenterView
window!.rootViewController = centerContainer
window!.makeKeyAndVisible()
我試圖改變窗口!.RootViewController = loginViewController但它給了我一個錯誤 –
發現任何解決方案? –
是的,一分鐘我會把答案 –