Questions tagged [catransaction]

CATransaction allows you to make batch updates to the Core Animation render tree, and it also allows to trigger implicit animations just by setting layer properties inside of a CATransaction.

CATransaction allows you to make batch updates to the Core Animation render tree. It is most used to override default animation timing functions, durations, etc. or to add a completion block to an animation that doesn't expose one explicitly.

CATransaction allows to trigger implicit animations just by setting layer properties inside of a transaction block. Animating the position of a layer in Objective C:

[CATransaction begin];
[CATransaction setAnimationDuration:0.5];
layer.position = newPosition;
[CATransaction commit];

or the same in Swift:

CATransaction.begin()
CATransaction.setAnimationDuration(0.5)
layer.position = newPosition
CATransaction.commit()

For more information, see the Apple Documentation for CATransaction.

76 questions
-1
votes
1 answer

CATransaction Animation Issue

I have a CAShapeLayer and trying to animate few properties. I did use CABasicAnimation in the beginning, but since this loops over and over, I need the most officient way to do it. Folowing code animates properly: private func…
Gizmodo
  • 3,151
  • 7
  • 45
  • 92
1 2 3 4 5
6