Open paradise opened 8 years ago
The same happens with me. I have a controller named LoginViewController another as MainViewController and 8 other controllers that I keep switching to via changeMainViewController().
When the application starts, in the AppDelegate, I instantiate like this:-
let leftViewController = R.storyboard.main.leftViewController() let mainViewController = R.storyboard.main.mainViewController() let navigationController: UINavigationController = UINavigationController(rootViewController: mainViewController!) leftViewController!.mainViewController = navigationController let slideMenuController = ExSlideMenuController(mainViewController:navigationController, leftMenuViewController: leftViewController!)
And then in MainViewController, based on a condition, I switch to LoginViewController by using the changeMainViewController() or switch to another controller named DashboardViewController.
The problem happens ONLY when I am switching from MainViewController to LoginViewController. I get the following message - Unbalanced calls to begin/end appearance transitions for <.LeftViewController: 0x7ff4d363d260>
If I am switching from any other controller to LoginViewController or from MainViewController to any other view controller, this DOESN'T happen.
And the code for switching controllers is the same everywhere.
Did anyone found solution for this?
Hi, maybe I do something wrong, but when I add LoginController and check if I logged or not logged in then I see 2016-03-09 03:59:50.400 SlideMenuControllerSwift[2738:84867] Unbalanced calls to begin/end appearance transitions for <SlideMenuControllerSwift.LeftViewController: 0x7fbee3591ec0>.
My MainViewController
override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) let prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults() let isLoggedIn:Int = prefs.integerForKey("ISLOGGEDIN") as Int if (isLoggedIn != 1) { delegate?.changeViewController(LeftMenu.Login) } else { print("Logged in"); } }
My LeftViewController
func changeViewController(menu: LeftMenu) { switch menu { case .Main: self.slideMenuController()?.changeMainViewController(self.mainViewController, close: true) case .Logout: logout() case .Login: self.slideMenuController()?.changeMainViewController(self.loginController, close: true) } }