Reputation: 1436
Supposed you've got:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UIViewController *rootViewController = [[UIViewController alloc] init];
rootViewController.view.backgroundColor = [UIColor whiteColor];
[self.window setRootViewController:rootViewController];
[self.window makeKeyAndVisible];
UINavigationController *modal = [[UINavigationController alloc] initWithRootViewController:[[PTFrontViewController alloc] init]];
modal.modalPresentationStyle = UIModalPresentationFormSheet;
[rootViewController presentViewController:modal animated:YES completion:NULL];
return YES;
}
whereas PTFrontViewController
and PTBackViewController
view controllers have nothing interesting for sake of this example.
How could you push an instance of PTBackViewController
from PTFrontViewController
animating as in UIViewAnimationTransitionFlipFromLeft
or UIViewAnimationTransitionFlipFromRight
?
I am already well aware of these three things:
presentViewController
UINavigationController
's default animationUINavigationController
's default animation while pushing and poping, but if you try the code for your self you will notice that when a view controller is presented via presentViewController
there are drop shadows and background views that won't get animated correctlySo please answer taking these things in mind. Thank you.
Upvotes: 0
Views: 1205
Reputation: 130210
First - forget UINavigationController
. If you don't need the default animation, just put a UINavigationBar
into your controllers. It will get a little easier.
Second - this is a difficult problem, you can't create such an animation only within the modal controller because the background wouldn't be repainted.
Sincerely, the easist solution I see is too forget the modal controller and just add the view controller as a child of your root controller. Then you can control all the animations but you have to write everything by yourself (including the background fading).
Upvotes: 1