I was wondering if the following is an accepted way to switch views?
AppDelegate.m
- (IBAction) switchViews
{
if (self.window.rootViewController == self.viewController) {
self.window.rootViewController = self.settingsNavigationViewController;
} else {
self.window.rootViewController = self.viewController;
}
}
Both viewController and settingsNavigationViewController are loaded from nib files when the application launches.
The main view (viewController) contains a scrollview with 3 image views for infinite scrolling effect, as well as a searchbar at the top and a toolbar at the bottom.
The second view is for my application settings. It is a navigation controller that performs similarly to a settings bundle.
Both views have a button that calls switchViews;
Do I need to restructure my app or is this a good way of doing this or do I need to restructure my app?