My second view controller is a table view controller. I wish to segue to a first view controller with a back button. I have tried using Editor>Embed In>Navigation Controller. It places a navigation bar on the top where I can place an Item (Back button) on it, and after segueing it back to my first view controller, it becomes very screwy (it shows two navigation bars on top of each other). Is there a better/easier way to move back to my first view controller?
if u want to use navigation controller to manage ur push&pop stuff, just make sure:
like this
then push like this
let secondVC = (self.storyboard?.instantiateViewControllerWithIdentifier("identifier"))! as! urVC secondVC.title = "second view controller" self.navigationController?.pushViewController(secondVC, animated: true)
and pop like this
self.navigationController?.popViewControllerAnimated(true)
alternatively, u can use unwind segue following this tutorial
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.