I'm using presentModalView controller and pushing the transition to new view via its controller. And I'm using following code to do the transition (which is working fine)
[self presentModalViewController:myViewController animated:NO];
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[[myViewController.view layer] addAnimation:animation forKey:@"SwitchToView"];
but the problem is that, its showing blank white screen and then transition starts. How to avoid this?
As this wasn't answered, I'll post what worked for me, to allow future seekers to find something useful:
I was trying to display a view in a different XIB file with a CATransition and always got a black screen at the beginning.
The solution was to replace these lines
with
After finding the issue, it was quite easy to understand, because obviously the local window is the one you want to "push".
first add animation then present
I think, uiviewcontroller.transitioningDelegate is the way to do it on iOS7 ans 8 :