Type Method

setAnimationDelegate:

Sets the delegate for any animation messages.

Declaration

+ (void)setAnimationDelegate:(id)delegate;

Parameters

delegate

An object that defines the methods registered using the setAnimationWillStartSelector: and setAnimationDidStopSelector: methods. The view maintains a strong reference to this object for the duration of the animation.

Discussion

You can specify an animation delegate in cases where you want to receive messages when the animation starts or stops. After calling this method, you should call the setAnimationWillStartSelector: and setAnimationDidStopSelector: methods as needed to register appropriate selectors. By default, the animation delegate is set to nil.

You primarily use this method to set the delegate for animation blocks created using the begin/commit animation methods. Calling this method from outside an animation block does nothing.

Use of this method is discouraged in iOS 4.0 and later. If you are using the block-based animation methods, you can include your delegate’s start and end code directly inside your block.

See Also

Animating Views

+ beginAnimations:context:

Marks the beginning of a begin/commit animation block.

Deprecated
+ commitAnimations

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

Deprecated
+ setAnimationStartDate:

Sets the start time for the current animation block.

Deprecated
+ setAnimationsEnabled:

Sets whether animations are enabled.

+ setAnimationWillStartSelector:

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

Deprecated
+ setAnimationDidStopSelector:

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

Deprecated
+ setAnimationDuration:

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

Deprecated
+ setAnimationDelay:

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

Deprecated
+ setAnimationCurve:

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

Deprecated
+ setAnimationRepeatCount:

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

Deprecated
+ setAnimationRepeatAutoreverses:

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

Deprecated
+ setAnimationBeginsFromCurrentState:

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

Deprecated
+ setAnimationTransition:forView:cache:

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

Deprecated
areAnimationsEnabled

Returns a Boolean value indicating whether animations are enabled.