10

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?

bneely
  • 9,083
  • 4
  • 38
  • 46
Richard Stelling
  • 25,607
  • 27
  • 108
  • 188
  • did you find a solution? I came up with the same problem. It looks like UIKit it applying the initial frame found in the transitionContext before executing any lines of code in the animateTransition method. – Rufel Dec 10 '13 at 22:43

0 Answers0