Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you animate setRootViewController?

I'm using a SplitViewController which can't be part of a navigation controller. I'm using SetRootViewController on an IBAction, which is fine, but it's not animated. Ideally I'd like to use the same animation as the Navigation Controller does (slide in from the left/right) but if that's not possible I'd like to use a consistent animation when ever I need to do this.

like image 651
glenstorey Avatar asked Mar 12 '12 17:03

glenstorey


1 Answers

I'm not sure about this, but I would suggest the following.

Set the UISplitViewController as your UIWindow's rootViewController. In the viewDidLoad, you make a presentModalViewController:animated: call with the button's UIViewController as modal. Make sure you don't animate it. This gives you the illusion that the modal view is the first you see when the app launches. When you push the button, you animate the button's UIViewController out with dismissModalViewControllerAnimated:. Now you can choose how to animate. One of your choices is cross disolve.

like image 163
Dries De Smet Avatar answered Oct 03 '22 16:10

Dries De Smet