Add the following lines:
[UIView setAnimationRepeatCount: HUGE_VAL]; [UIView setAnimationRepeatAutoreverses: YES];
Or, if you are targeting iOS 4.0+, itβs preferable to use lock animation:
[UIView animateWithDuration:40.0f delay:0.0f options: UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionBeginFromCurrentState animations: ^(void){imageview.center = CGPointMake(0, 200);} completion:NULL];
source share