Search code examples
ioscocoa-touchsegue

How to return to original scene?


I navigate from scene A to scene B with a segue and want to return to A by touching a button. Do I have to create a new segue to get back or should I do something else? If I create a new segue, will it be a circular-reference?


Solution

  • It depends on the way you segue if you are using modal segue style then you have to do this,

    [self dismissModalViewControllerAnimated:YES];
    

    if push style segue

    [self.navigationController popViewControllerAnimated:YES];
    

    Do any one depending on your segue style in the IBAction method of the button you wish to use.