That's simply not how UIKit animations work. I sort-of explain how half of it works in this answer, but I'll try to summarize the relevant bits:
- Everything is a textured rectangle. (There are some exceptions, like perhaps CAShapeLayer, but this is true for the most part.)
UIView
's properties are linked to CALayer's "model tree" properties. They change instantaneously.
- Animations work by animating the "presentation tree" properties from the starting value to the current model value.
- The starting value of the animation is, by default, the previous model value. Specifying
UIViewAnimationOptionBeginFromCurrentState
makes it use the current presentation value.
There are, of course, a few exceptions (CAShapeLayer
seems to be more than a textured rect, UIScrollView
does scrolling animations on a timer, UIView transitions are another thing entirely...).
How rotation is supposed to work is that you get a single -setFrame:
, everything is laid out (and potentially rerendered), and then the animatable properties are animated. By default, this means things will rerender to the new dimensions but get stretched to fit the old dimensions, and then animate (and unstretch) as the rotation progresses.
That said, GLKView
might work differently. If you're using GLKViewController
, it might even suspend rendering during the rotation animation. You could try calling -setNeedsDisplay
during the rotation, but it won't help much since the frame is already set to its final value.
Probably the easiest way to handle the rotation animation yourself is to force a non-animated relayout to the rotated frame and then do some fudging in the renderer (the black border and status bar animate separately though).
Alternatively, the traditional way is to make your VC portrait-only and handle the device orientation notifications yourself, but this is a big can of worms (you then have to worry about the status bar orientation which determines things like the touch offset and keyboard orientation, and it tends to interacts "interestingly" when transitioning to/from other VCs).
GLKBaseEffect
and my own shaders - the same result.-drawRect:
will be called after animation finished - so any GL rendering (that we normally place there) will be suspended to that moment. – Cumin