Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macinsmith

macrumors newbie
Original poster
Jan 22, 2010
3
0
I have an app that uses a navigation controller and want to have a preferences view. Typically when this view is brought up, the current view rotates as if the preferences is on the back of that view. I have made this work in a non-navigation controller based app, but am having troubles getting it to work in a navigation based app. I want the entire view including the Nav bar to rotate out. Here is what I'm doing. This code is in the a subclass of UIViewController

Code:
PrefsViewController *prefsViewController = [[PrefsViewController alloc] initWithNibName:@"PrefsView" bundle:nil];

     [UIView beginAnimations:@"View Flip" context:nil];
     [UIView setAnimationDuration:1.25];
     [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
     
     UIViewController *coming = prefsViewController;
     UIViewController *going = self.navigationController; // (I've also tried setting going = self
     UIViewAnimationTransition transition= UIViewAnimationTransitionFlipFromLeft;
     
     [UIView setAnimationTransition: transition forView:self.view cache:YES];
     [coming viewWillAppear:YES];
     [going viewWillDisappear:YES];
     [going.view removeFromSuperview];
     [self.view insertSubview: coming.view atIndex:0];
     [going viewDidDisappear:YES];
     [coming viewDidAppear:YES];
     
     [UIView commitAnimations];

Any ideas?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.