Repeat an animation a variable number of times

Had the same problem - you were missing an an'UIViewAnimationOptionRepeat'

This should work:

 [UIView animateWithDuration:0
                      delay:1
                    options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionRepeat
                 animations:^{
                     [UIView setAnimationRepeatCount:2]; // **This should appear in the beginning of the block**
                     [self animatePage];

                 }
                 completion:nil];

Did the trick for me.


Did you try to set the repeatCount? + (void)setAnimationRepeatCount:(float)repeatCount

I've tried the following code block, and it definitely repeats 2x for me (l was a UITextView that was scaled up by 2x in X dir and 3X in Y dir):

[UIView animateWithDuration:2 
delay:0.1 
options:UIViewAnimationOptionCurveEaseIn 
animations:^{ [UIView setAnimationRepeatCount:2]; 
l.transform = CGAffineTransformMakeScale(2,3); } completion:nil];