MeloS
MeloS

Reputation: 7938

What's the difference between CATransaction and CAAnimation?

maybe duplicated with some question, but I can't find them here.

Upvotes: 0

Views: 2080

Answers (2)

Yuanhai Shi
Yuanhai Shi

Reputation: 333

  1. CAAnimation is an abstract superclass using CAMediaTiming protocol that can regulate the time,including duration, speed, repetition;also using CAAction protocol, display animation by way of response actions.
  2. CATransaction is a derived class of CAAnimation.It can modify properties of multiple layers at same time. It has two types of transactions:

    a. explicit transaction, Submitting animation by invoking "begin","commit" explicitly,Reset duration.Transactions can be nesting;

    b. implicit transaction. In addition to explicit transaction, any modifications for CALayer properties are implicit transaction, so the transaction will be submitted in the run-loop.

Hope it helps u.

Upvotes: 2

Related Questions