I’m trying to implement a UIView animation block with animationWithDuration and multiple options. It is working fine except it only seems to use one of the options I specify instead of all three. Is there a limit to the number of options I can specify or a limit on certain combinations of options?
Below is my code. “starRotator” is a UIImageView in a UIView that I’m rotating. I tried wrapping the options in parentheses, but that didn’t work either. It seems to only take the UIViewAnimationOptionRepeat option and ignore the other two.
[UIView animateWithDuration:30.0
delay:0.0
options:UIViewAnimationCurveLinear | UIViewAnimationOptionRepeat | UIViewAnimationOptionBeginFromCurrentState
animations:^{
starRotator.superview.transform = CGAffineTransformMakeRotation(M_PI);
}
completion:^(BOOL finished){ }
];
Did you notice that two of the constants you’re using as options contain the word “Option”, but one doesn’t?
The correct option constant for a linear curve is
UIViewAnimationOptionCurveLinear, but you usedUIViewAnimationCurveLinear.