ColinEberhardt / VCTransitionsLibrary

A collection of iOS7 animation controllers and interaction controllers, providing flip, fold and all kinds of other transitions.
Other
4.55k stars 617 forks source link

UINavigation controller with VCTransitionLibrary pop shows black screen when pushed without animation #30

Open dulgan opened 10 years ago

dulgan commented 10 years ago

Hi,

I followed your tutorials and use your VCTransitionLibrary in my app, here is my App structure : 1) A NavigationController is the root of the application (using your tutorial code) 2) MyRootViewController is the root view controller in the NavigationController 3) MyPushedViewController is pushed or poped with animations by MyRootViewController

Everything is fine with animations, but a problem occur in the following configuration : 1) MyRootViewController is on screen, (the only ViewController in the NavigationController stack) 2) App goes to background 3) App goes to foreground : 3.1) applicationWillEnterForeground fires a notification to NSNotificationCenter defaultCenter 3.2) MyRootViewController listen to this notification and execute the following code : // pop to root [self.navigationController popToRootViewControllerAnimated:NO]; // instantiate new view controller MyPushedViewController *mpvc = [self.storyboard instantiateViewControllerWithIdentifier:@"MyPushedViewController"]; // mpvc init code... // ... // push the new view controller [self.navigationController pushViewController:ncvc animated:NO]; 4) MyPushedViewController is displayed without any problem 5) User swipe to trigger a pop, and MyRootViewController is black, not appearing in animation (but it's viewWillAppear is triggered).

I need to use animated:NO because I don't want the app to show anything else than MyPushedViewController when it's back to foreground. The is no problem in any other configuration : animated:YES display the animation fine when MyPushedViewController was on screen, it's also working fine

Do you have any clue about this problem ?

Thanks for your work and your time !

andriternovy commented 10 years ago

Hi,

I had same issue, so I found workaround.

Replace - (void)animateTransition:(id)transitionContext method in the CEReversibleAnimationController for next code: