I have an endlessly looping CABasicAnimation of a repeating image tile in my view:
a = [CABasicAnimation animationWithKeyPath:@\"position\"];
a
I can't comment so I will add it as an answer.
I used cclogg's solution but my app was crashing when the animation's view was removed from his superview, added again, and then going to background.
The animation was made infinite by setting animation.repeatCount to Float.infinity.
The solution I had was to set animation.removedOnCompletion to false.
It's very weird that it works because the animation is never completed. If anyone has an explanation, I like to hear it.
Another tip: If you remove the view from its superview. Don't forget to remove the observer by calling NSNotificationCenter.defaultCenter().removeObserver(...).