Question

I am trying create flip animation between ViewController's but it doesn't work:

BHAppDelegate *app = [[UIApplication sharedApplication] delegate];
UINavigationController *tabBarController = [self.storyboard instantiateViewControllerWithIdentifier:@"NavigationController"];

BHViewController *leftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"leftMenu"];

PKRevealController *revealController = [PKRevealController revealControllerWithFrontViewController:tabBarController leftViewController:leftViewController];
[revealController setMinimumWidth:220 maximumWidth:220 forViewController:tabBarController];

[UIView beginAnimations:@"animation" context:nil];
    app.window.rootViewController = revealController;
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
Was it helpful?

Solution

Sorry but why you are setting the revealController as rootViewController on the UIWindow? I think that your code above is in your rootViewController and so from your rootViewController you should use this way to present the revealController:

    [revealController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [self presentViewController:revealController animated:YES completion:nil];

and in the revealController you will use this way to dismiss and come back to the rootViewController:

    [self dismissViewControllerAnimated:YES completion:nil];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top