In my app where I use Parse.com framework, afer any operation for example sign up
I would like to go to another sotyboard for example login
, so I do this code:
user.signUpInBackgroundWithBlock({ (succeeded: Bool, error: NSError?) -> Void in
if error != nil{
// alert Error
} else {
let action = UIAlertController(title: "Congratulattion!", message: "Now yu can start chatting", preferredStyle: .Alert)
let ok = UIAlertAction(title: "OK", style: .Default, handler: { (alert) -> Void in
let mainVC = self.storyboard?.instantiateViewControllerWithIdentifier("login") as! LogInViewController
self.presentViewController(mainVC, animated: true, completion: nil)
})
action.addAction(ok)
self.presentViewController(action, animated: true, completion: nil)
}
afert this segue my NavgationBar
disappears. My Application looks like that:
What Do I need to do, my Navbar
doesn't disappear?
Picture with error which I see after segue from
Sign Up App Chat
toWelcome in Chat App
usingself.performSegueWithIdentifier("signup", sender: self)
I don't think you want to use the code self.storyboard?.instantiateViewControllerWithIdentifier("login") as! LogInViewController
self.storyboard?.instantiateViewControllerWithIdentifier("login") as! LogInViewController
. It looks like you are going from your signup controller to the login controller in your code, so you might want to add a segue connecting those 2 in your storyboard, and if you make it a segue of type 'show', then the navigation bar will stay intact. Then you can call performSegue
on this segue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.