So, in my rotation handler, I am doing some layout for the landscape mode. I wanted to perform some additional animation after the rotation completed, so I increased the duration to a larger value and started a keyframe type animation.
What I find is that for some reason I can't effectively increase the duration. The code below seems to run in the timespan of the rotation (0.4 seconds or whatever) no matter what I set duration to.
Is there something about a rotation animation already being in progress that prevents a longer animation from being started?
Thanks for any help.
- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation duration:(NSTimeInterval) duration
{
duration = 10.0; // overriding the duration to a longer value
// running some keyframed animation over the longer animation
[UIView animateKeyframesWithDuration: duration delay:0.0 options:UIViewKeyframeAnimationOptionBeginFromCurrentState
animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0
relativeDuration:total_duration_sec
animations:^{ /*do some stuff */ }];
}