Scott Zhu
Scott Zhu

Reputation: 8461

What are the differences between these three concepts, Animation, Transition and Transaction in iOS

These three concepts are all from Core Animation, but i don't really understand the difference between them. Because animation and transition seems quite similar to me, and transaction as well.

Upvotes: 7

Views: 3922

Answers (1)

Duncan C
Duncan C

Reputation: 131481

Animation is a general term for making a view object change it's appearance smoothly from one state to another state over time.

A transition is a specific type of animation for switching between views, view controllers, or layers. The Core Animation framework includes specific calls to support transitions, as well as more general-purpose animations. There are also UIKit calls that handle view and view controller transitions. (See, for example, transitionFromView:toView:duration:options:completion:, transitionFromViewController:toViewController:duration:options:animations:completion:, and transitionWithView:duration:options:animations:completion: )

A "transaction" is a Core Animation term that refers to a discrete set of UI changes that are grouped together and submitted to the Core Animation engine for rendering together as a group. Most of the time the system creates animation transactions for you behind the scenes as a result of your animation code (known as "implicit transactions".) Take a look at the Xcode docs for CATransaction for more information.

Upvotes: 21

Related Questions