I am new in iOS development. I have this Storyboard:

When I click on Page 1 Bar button item –> go to Page 2 with back button (using push segue)
And basically by click on the back button –> go back to Page 1
As you see I have a Save bar button in Page 2, my question is when I click on this button I want to save my data in database and come back to Page1.
Can you help me how can I go back to first page?
- (void)save:(id)sender
{
NSLog(@"Save");
// SaveDataToDb
if(Data successfully saved in database)
//Go Back to Page 1 ???
else
// Proper error message
}
1 Answer