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

macinsmith

macrumors newbie
Original poster
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?
 
Found solution in another post

Here's the code I found in another post

Code:
- (IBAction)infoButtonWasPressed:(id)sender {
    // Display modal info view as flipside view
    PrefsViewController * prefsViewController = [[PrefsViewController alloc] initWithNibName:@"PrefsView" bundle:nil];
    prefsViewController = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController: prefsViewController animated:YES];
    [prefsViewController release];
}

This works just fine.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.