finishAnimation(at:)
Finishes the animations and returns the animator to the inactive state.
Declaration
func finishAnimation(at finalPosition: UIViewAnimatingPosition)Parameters
- finalPosition:
The final position for any view properties. Specify Current to leave the view properties unchanged from their current values.
Discussion
After putting the animator object into the UIViewAnimatingState.stopped state, call this method to perform any final cleanup tasks. It is a programmer error to call this method at any time except after a call to the stopAnimation(_:) method where you pass false for the withoutFinishing parameter. Calling this method is not required, but is recommended in cases where you want to ensure that completion blocks or other final tasks are performed.
Implementations of this method are responsible for setting the state of the animator object to UIViewAnimatingState.inactive and for performing any final cleanup tasks, such as executing completion blocks.