Tony Lukasavage
Tony Lukasavage

Reputation: 1937

Is there a way to change Views in iOS without using UINavigationController?

I have a login page at the beginning of my app that I do not want on the view stack. Is there a way to load my first post-login view after the login without using UINavigatorController?

Is there a better way to be doing this? Should I be using 2 UINavigationControllers? Is there a way to change the RootViewController for a UINavigationController?

Upvotes: 5

Views: 5677

Answers (2)

aceofspades
aceofspades

Reputation: 7586

You might also look at UIViewController#presentViewController

Upvotes: 0

hoha
hoha

Reputation: 4428

Yes, you can change root controller of window. Set window's property rootViewController to new controller and you're done. Don't forget though that first controller (one you are removing) will not receive viewWillDisappear: and viewDidDisappear: messages. Send them yourself before switching controllers if you're interested in them.

Upvotes: 8

Related Questions