From the iphone system APP “Contacts”, in the “All Contacts” GUI and click “Add”, it will segue to “New Contact” GUI. Then from the “New Contact” GUI and add “new” item then click “Done”, it will seuge to the contact detail GUI(screenshot image 3). The issue is that: I used “Show(push)” to segue to image 3 from “Done” button, but the NavagationItem in the left corner displayed as “ back to New Contact “ rather than “back to All Contact”.
I attached the screenshot to describe the issue as bleow: screenshot
I tried two ways: way 1: pop the vc which matches the image2. The isssue is that New Record page will jump to image1 first, then jump to image3.
if let nav = self.parentViewController as? UINavigationController {
if let vc0 = nav.childViewControllers.last as? AddRecordTableViewController {
nav.popViewControllerAnimated(true)
}
}
performSegueWithIdentifier(Constants.SegueAddRecordVCToViewRecordVC, sender: nil)
way 2: used the removeFromParentViewController to discard the vc matches image2. The issue is that the Navagation bar button in the left corner still displayed as “
if let nav = self.parentViewController as? UINavigationController {
if let vc0 = nav.childViewControllers.last as? AddRecordTableViewController {
vc0.removeFromParentViewController()
}
}
performSegueWithIdentifier(Constants.SegueAddRecordVCToViewRecordVC, sender: nil)