In my project's main ViewController, once users of the app click the "Start" button, I add the next view to the screen:
UIViewController *nextController = [[GamePlayViewController alloc] initWithNibName:@"GamePlayView" bundle:nil];
[self addChildViewController:nextController];
[self.view addSubview:nextController.view];
Now, when users want to click back to the main menu, what is the proper code to run?
I know I can transition from one viewController to another, like so:
[self transitionFromViewController:currentPageController
toViewController:nextController
duration:0
options:UIViewAnimationOptionTransitionCurlDown
animations:nil
completion:^(BOOL finished) { [nextController didMoveToParentViewController:self]; }];
But what if I just want to transition back to the project's main ViewController?
THANKS!