Sets a transition to apply to a view during an animation block.
- iOS 2.0–13.0Deprecated
- Mac Catalyst 13.0–13.0Deprecated
- tvOS 9.0–13.0Deprecated
A transition to apply to
view. Possible values are described in
The view to apply the transition to.
YES, the before and after images of
vieware rendered once and used to create the frames in the animation. Caching can improve performance but if you set this parameter to
YES, you must not update the view or its subviews during the transition. Updating the view and its subviews may interfere with the caching behaviors and cause the view contents to be rendered incorrectly (or in the wrong location) during the animation. You must wait until the transition ends to update the view.
NO, the view and its contents must be updated for each frame of the transition animation, which may noticeably affect the frame rate.
If you want to change the appearance of a view during a transition—for example, flip from one view to another—then use a container view, an instance of
UIView, as follows:
Begin an animation block.
Set the transition on the container view.
Remove the subview from the container view.
Add the new subview to the container view.
Commit the animation block.
Use of this method is discouraged in iOS 4.0 and later. You should use the
transition method to perform transitions instead.