Basically I have a view controller that pushes to the next view controller with [self performSegueWithIdentifier: sender:];
and in the prepareForSegue
I wanted to change the VC's title to "Back" so that in the next VC the back bar button item will be "Back" instead of the initial VC's title.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
self.title = @"Back";
}
Now the problem is that when I return back to the first VC by tapping on the Back button, I have to change the title back to the initial title or else the title will stay as "Back".
If only there was a method like prepareForSegue
so that I can get the destination VC and change it's title...
Another example is that I have a storyboard of 3 view controllers like so:
I've hidden the navigation controller to use my own button to go back the segue. While this way works, but it seems rather odd that I have to add 2 more segues just to return back to the first VC...