Instance Method


Adds the specified completion block to the animator.


optional func addCompletion(_ completion: @escaping (UIViewAnimatingPosition) -> Void)



A block to execute when the animations finish. This block has no return value and takes the following parameter:


The position where the animations stopped. Use this value to specify whether the animations stopped at their starting point, their end point, or their current position.


Use this method to add the completion blocks to your custom animator object. Completion blocks should execute after the animations finish successfully. If the stopAnimation(_:) method is called, do not execute any completion blocks if the withoutFinishing parameter for that method contains the value true. If the parameter is false and the client subsequent calls the finishAnimation(at:) method, execute the completion blocks in your implementation of that method. Your implementation must be able to handle multiple calls to this method.

See Also

Modifying Animations

func addAnimations(() -> Void)

Adds the specified animation block to the animator.

func addAnimations(() -> Void, delayFactor: CGFloat)

Adds the specified animation block to the animator with a delay.