No, this is the way you’re supposed to do it according to the documentation.
Setting this property to
HUGE_VALF
will cause the animation to repeat forever.
Update for Swift:
HUGE_VALF is not exposed to Swift. However, my understanding from this page is that HUGE_VALF is intended to be infinity (in fact, INFINITY
is defined as HUGE_VALF
). Since Swift’s FloatingPointType
protocol provides a static var infinity
, you can simply write
myAnimation.repeatCount = .infinity