stopAnimation(_:)
Stops the animations at their current positions.
Declaration
func stopAnimation(_ withoutFinishing: Bool)Parameters
Discussion
Call this method when you want to end the animations at their current position. This method removes all of the associated animations from the execution stack and sets the values of any animatable properties to their current values. This method also updates the state of the animator object based on the value of the withoutFinishing parameter.
If you specify false for the withoutFinishing parameter, you can subsequently call the finishAnimation(at:) method to perform the animator’s final actions. For example, a UIViewPropertyAnimator object executes its completion blocks when you call this method. You do not have to call the finishAnimation(at:) method right away, or at all, and you can perform other animations before calling that method.