Type Method


Sets the amount of time (in seconds) to wait before animating property changes within an animation block.


class func setAnimationDelay(_ delay: TimeInterval)


If you specify your animations using begin/commit set of methods, you use this method to specify the amount of time to wait before starting the animations. This method does nothing if called from outside of an animation block. It must be called between calls to the beginAnimations(_:context:) and commitAnimations() methods. And you must call this method prior to changing the animatable properties of your views. The default value is 0.0 seconds.

Use of this method is discouraged in iOS 4.0 and later. Instead, you should use theanimate(withDuration:delay:options:animations:completion:) method to specify your animations and the starting delay.

See Also

Animating Views

class func beginAnimations(String?, context: UnsafeMutableRawPointer?)

Marks the beginning of a begin/commit animation block.

class func commitAnimations()

Marks the end of a begin/commit animation block and schedules the animations for execution.

class func setAnimationStart(Date)

Sets the start time for the current animation block.

class func setAnimationsEnabled(Bool)

Sets whether animations are enabled.

class func setAnimationDelegate(Any?)

Sets the delegate for any animation messages.

class func setAnimationWillStart(Selector?)

Sets the message to send to the animation delegate when the animation starts.

class func setAnimationDidStop(Selector?)

Sets the message to send to the animation delegate when animation stops.

class func setAnimationDuration(TimeInterval)

Sets the duration (measured in seconds) of the animations in an animation block.

class func setAnimationCurve(UIView.AnimationCurve)

Sets the curve to use when animating property changes within an animation block.

class func setAnimationRepeatCount(Float)

Sets the number of times animations within an animation block repeat.

class func setAnimationRepeatAutoreverses(Bool)

Sets whether the animations within an animation block automatically reverse themselves.

class func setAnimationBeginsFromCurrentState(Bool)

Sets whether the animation should begin playing from the current state.

class func setAnimationTransition(UIView.AnimationTransition, for: UIView, cache: Bool)

Sets a transition to apply to a view during an animation block.

class var areAnimationsEnabled: Bool

Returns a Boolean value indicating whether animations are enabled.