addCompletion(_:)
Adds the specified completion block to the animator.
Declaration
optional func addCompletion(_ completion: @escaping (UIViewAnimatingPosition) -> Void)optional func addCompletion() async -> UIViewAnimatingPositionParameters
- completion:
A block to execute when the animations finish. This block has no return value and takes the following parameter:
- finalPosition
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.
Discussion
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.