Type Method

animateWithDuration:animations:

Animate changes to one or more views using the specified duration.

Declaration

+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations;

Parameters

duration

The total duration of the animations, measured in seconds. If you specify a negative value or 0, the changes are made without animating them.

animations

A block object containing the changes to commit to the views. This is where you programmatically change any animatable properties of the views in your view hierarchy. This block takes no parameters and has no return value. This parameter must not be NULL.

Discussion

This method performs the specified animations immediately using the UIViewAnimationOptionCurveEaseInOut and UIViewAnimationOptionTransitionNone animation options.

During an animation, user interactions are temporarily disabled for the views being animated. (Prior to iOS 5, user interactions are disabled for the entire application.)

See Also

Animating Views with Block Objects

animateWithDuration:delay:options:animations:completion:

Animate changes to one or more views using the specified duration, delay, options, and completion handler.

animateWithDuration:animations:completion:

Animate changes to one or more views using the specified duration and completion handler.

transitionWithView:duration:options:animations:completion:

Creates a transition animation for the specified container view.

transitionFromView:toView:duration:options:completion:

Creates a transition animation between the specified views using the given parameters.

animateKeyframesWithDuration:delay:options:animations:completion:

Creates an animation block object that can be used to set up keyframe-based animations for the current view.

addKeyframeWithRelativeStartTime:relativeDuration:animations:

Specifies the timing and animation values for a single frame of a keyframe animation.

performSystemAnimation:onViews:options:animations:completion:

Performs a specified system-provided animation on one or more views, along with optional parallel animations that you define.

animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:

Performs a view animation using a timing curve corresponding to the motion of a physical spring.

performWithoutAnimation:

Disables a view transition animation.