Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

return to ViewController after presentViewController

Im trying to return to a specific ViewController in it's current state after going from that ViewController to another using presentViewController.

But when I try to close the other ViewController (with dismissViewController) I get a white screen.

RootViewController *rootViewController 
   = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]
             instantiateViewControllerWithIdentifier:@"RootViewController"];
    [self presentViewController:rootViewController animated:YES completion:nil];

This isn't an option either because that instantiates a new viewcontroller and I want the old ViewController in its current state.

Do I need to pass the RootViewController as an argument when presenting the other ViewController or is there another option to return to the RootViewController in its current state?

like image 970
Mark Molina Avatar asked Apr 29 '26 00:04

Mark Molina


1 Answers

Yes, there is a way to return original screen. I met just like problem but solved it with following code line

[self dismissViewControllerAnimated:YES completion:nil];
like image 93
user3704354 Avatar answered May 02 '26 07:05

user3704354



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!