Contents

setAnimationRepeatCount(_:)

Sets the number of times animations within an animation block repeat.

Declaration

class func setAnimationRepeatCount(_ repeatCount: Float)

Parameters

  • repeatCount:

    The number of times animations repeat. This value can be a fraction. If you specify the value 0, the animation is performed once without repeating.

Discussion

Use this method to specify the number of times to repeat the specified animations. This method does nothing if called from outside of an animation block. You can use this method in conjunction with either the block-based methods or the begin/commit methods for defining an animation block. If you do not explicitly set a repeat count, the animation is not repeated.

If you pass the repeat option to the animate(withDuration:delay:options:animations:completion:) method without setting an explicit repeat count, the animation repeats indefinitely. If you want the animation to repeat a finite number of times, call this method from inside your block.

See Also

Deprecated methods