Question

this is my code to perform a modal segue when a button is clicked:

-(IBAction)segueAction:(id)sender{
    [self performSegueWithIdentifier:@"mySegue" sender:self];}

The problem is that when i get in the new View there is no BackButton to get back to the previous one. I'd like it to appear. What can i do?

Was it helpful?

Solution

The [Back] button does not appear when you show views modally, because there is no navigation stack with which you could go back to a previous view.

You need to either add your own [Close] button to the view controller that you opened modally, or use a navigation view controller, and push the new view controller on the stack.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top