There is currently no prepareForDesegue:sender: alternative to prepareForSegue:sender: Recommended practice is to set the link at the ViewController back to the ViewController source. Then, when the destination of the ViewController rejected, it can notify the source of the ViewController that it will again become the top ViewController . Typically, the link is set to prepareForSegue:sender:
So, to make it specific, suppose you have ViewControllerA , and just about move on to ViewControllerB . In ViewControllerB you must define a property that references ViewControllerA . (This is often done using protocols, but to make it simple, just assume that ViewControllerB has @property ViewControllerA *delegate; ) Then in prepareForSegue:sender: you will do the following:
ViewControllerB * vcB = (ViewControllerB *)[segue destinationViewController]; vcB.delegate = self;
Later, in ViewControllerB , in any code that returns you to ViewControllerA , you should use self.delegate to return to ViewControllerA , and tell it that it should be presented, and give it the opportunity to do whatever you need, using the UINavigationBar .
source share