Search code examples
swiftcore-animationcatransaction

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)?


Solution

  • 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.