I'm using a custom transition to slide a view controller 2/3 off screen when - presentViewController:animated:completion:
is called and slide it back again when dismissViewControllerAnimated:completion:
is called.
I'm also using UIPercentDrivenInteractiveTransition attached to a UIScreenEdgePanGestureRecognizer
to slide the view controller.
All works well, except when calling dismissViewControllerAnimated:completion:
, before:
- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext
is called the frame of the view controller slid off screen is set to:
(0 0; 320 568)
causing it to momentarily "flash" before the animation runs and it slides from 2/3 off screen back to full screen.
By subclassing the UIView on the View Controller I can set a break point in -setFrame
it shows the method:
[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:animation:]
is calling -setFrame
with (0 0; 320 568)
.
Why is it doing this? How can I prevent it from setting the frame before the animation starts?