0

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 1

1

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;
}
1
  • 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.
    – Ben Flynn
    Commented May 29, 2012 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.