I have an endlessly looping CABasicAnimation
of a repeating image tile in my view:
a = [CABasicAnimation animationWithKeyPath:@\"position\"];
a
It's surprising to see that this isn't more straightforward. I created a category, based on cclogg's approach, that should make this a one-liner.
CALayer+MBAnimationPersistence
Simply invoke MB_setCurrentAnimationsPersistent
on your layer after setting up the desired animations.
[movingView.layer MB_setCurrentAnimationsPersistent];
Or specify the animations that should be persisted explicitly.
movingView.layer.MB_persistentAnimationKeys = @[@"position"];