addCoordinatedUnfocusingAnimations(_:completion:)
Runs the specified set of animations together with the system animations for removing focus from an item.
Declaration
func addCoordinatedUnfocusingAnimations(_ animations: ((any UIFocusAnimationContext) -> Void)?, completion: (() -> Void)? = nil)Parameters
- animations:
A block object containing your unfocus-related animations. This block has no return value and takes the following parameter:
- context
An object containing information about the main animations. Use this information to configure your custom animations. For more information, see Uifocusanimationcontext.
- completion:
The block object to execute after the main animation completes. The specified animations are run in the same animation context as the main animation.
Discussion
When focus is being removed from an item, use this method to coordinate your custom animations with the system animations. The animations you specify are run in the same animation block as the system animations. Use the information in the context parameter to determine any custom behaviors for your animations. For example, you might configure your animations to run in half the time as the main animation and start after a short delay.