iOS UIScrollView animation after animation
animation, ios, uiscrollview
Solution
Two options:
1) Use the `-(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView` delegate callback
2) Try to put it into an animation block (with `... animated:NO];`), which has the completion part.
Problem
I want something similar in purpose to Flipboard slight flipping animation on app start. Flipboard when launched has this slight flipping of up and down to show users unfamiliar with the interface that it is flippable. I have a UIScrollView I want to animate a bit to show the user that it's scrollable. So I want to scroll to the right a little bit and back. UIScrollView has a `setContentOffset:animated:` message without a completion clause. I find that calling it twice results in seemingly no animation. What if I want an animation after animation in succession? EDIT: Thanks Levi for the answer. And for the record, there is `UIViewAnimationOptionAutoreverse` and `UIViewAnimationOptionRepeat` that I can use. So this is what I ended up with that works. ``` CGPoint offset = self.scrollView.contentOffset; CGPoint newOffset = CGPointMake(offset.x+100, offset.y); [UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAutoreverse |UIViewAnimationOptionRepeat animations:^{ [UIView setAnimationRepeatCount: 2]; [self.scrollView setContentOffset:newOffset animated: NO]; } completion:^(BOOL finished) { [self.scrollView setContentOffset:offset animated:NO]; }]; ```