I have a UIViewController subclass that can display animations (mostly changing alphas on imageview subviews). If an animation is occurring when the device is rotated, I would like the rotation animation to occur after the current animation block completes. How can I make this happen?
1 Answer
When you call a method that animated an image, set some BOOLean value to NO and conditionally allow rotation in the -shouldAutorotateToInterfaceOrientation
method. Something like this:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if (!someBool)
return NO;
return YES;
}
-
That's where I was stuck. This prevents the rotation during the animation -- to get it to possibly rotate afterwards it looks like I need to call "attemptRotationToDeviceOrientation". I should also add code to prevent animations from occurring during the animation itself. Commented May 29, 2012 at 5:43