Razattax
Razattax

Reputation: 163

Swift: Difference between two CAAnimation Disables

I am currently working with CABasic Animations on CALayers in Swift.

What is the difference between CATransaction.setValue(kCFBooleanTrue, forKey:kCATransactionDisableActions) and CATransaction.setDisableActions(true)?

Upvotes: 1

Views: 125

Answers (1)

Ozgur Vatansever
Ozgur Vatansever

Reputation: 52203

From docs on .setDisableActions:

This is a convenience method that invokes setValue(_:forKey:) with an NSNumber containing a true for the kCATransactionDisableActions key.

So, they basically do the same thing. Former is the KVC-way of doing it.

Upvotes: 2

Related Questions