I calling the login segue to another view controller (login view) like this , I have to set it my login view as front view controller when prepareForSegue or else i dont know why my side menu will be keep stick in the front view, which my login view will not be fully display:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showSegue" {
self.revealViewController().revealToggleAnimated(false)
let vc = storyboard!.instantiateViewControllerWithIdentifier("LoginViewController")as! LoginViewController
self.revealViewController().setFrontViewController(vc, animated: false)
}
}
And after user have successfully login in the login view, it should be popup a alert view notice the user have success login and back to the previous page, and i using unwind segue:
let message = (MCLocalization.sharedInstance.stringForKey("login_success_message", replacements: ["%s" : fullName]))
let alert = UIAlertController(title: (MCLocalization.sharedInstance.stringForKey("login_success_title")), message: message, preferredStyle: UIAlertControllerStyle.Alert)
let OKAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {
(_)in
self.performSegueWithIdentifier("unwindSideMenu", sender: self)
})
alert.addAction(OKAction)
self.presentViewController(alert, animated: false, completion: nil)
But the unwind segue its not working, it come out this error:
2016-07-20 10:44:47.945 Jocom[9475:501947] Unbalanced calls to begin/end appearance transitions for <Jocom.LoginViewController: 0x7fbad2817630>.
How should i solve this problem?