Programming MVC view controllers - iOS

How to programmatically switch view controller in iOS?

So, an example - I have an MVC setup menu, now I click "Help". How to programmatically pass this to the help view controller to load this MVC installation?

+5
source share
2 answers

Is this application based on View or Navigation?

For a navigation-based application, your AppDelegate should give you access to a common UINavigationController, which you can use to push / pop UIViewControllers

[self.navController pushViewController:helpViewController animated:YES]

, , . "/" UINavigationBar, popViewcontrollerAnimated:

[self.navController popViewControllerAnimated:YES]

View ,

[window addSubview:helpViewController.view]
+5

Utility . , .

,

[self presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated];

HelpViewController

[self dismissModalViewControllerAnimated:(BOOL)animated]; //call to return back to parent view controller

^^

+1

All Articles