Type Method

setAnimationsEnabled(_:)

Sets whether animations are enabled.

Declaration

class func setAnimationsEnabled(_ enabled: Bool)

Parameters

enabled

Specify true to enable animations or false to disable them.

Discussion

Animations are enabled by default. If you disable animations, code inside subsequent animation blocks is still executed but no animations actually occur. Thus, any changes you make inside an animation block are reflected immediately instead of being animated. This is true whether you use the block-based animation methods or the begin/commit animation methods.

This method affects only those animations that are submitted after it is called. If you call this method while existing animations are running, those animations continue running until they reach their natural end point.

See Also

Related Symbols

areAnimationsEnabled

A Boolean value indicating whether animations are enabled.

class func performWithoutAnimation(() -> Void)

Disables a view transition animation.