Swift: 两个 CAAnimation 禁用之间的区别
Swift: Difference between two CAAnimation Disables
我目前正在 Swift 的 CALayers 上使用 CABasic Animations。
CATransaction.setValue(kCFBooleanTrue, forKey:kCATransactionDisableActions)
和CATransaction.setDisableActions(true)
有什么区别?
来自 .setDisableActions
上的文档:
This is a convenience method that invokes setValue(_:forKey:)
with an NSNumber containing a true for the kCATransactionDisableActions key.
所以,他们基本上做同样的事情。前者是 KVC 的做法。
我目前正在 Swift 的 CALayers 上使用 CABasic Animations。
CATransaction.setValue(kCFBooleanTrue, forKey:kCATransactionDisableActions)
和CATransaction.setDisableActions(true)
有什么区别?
来自 .setDisableActions
上的文档:
This is a convenience method that invokes
setValue(_:forKey:)
with an NSNumber containing a true for the kCATransactionDisableActions key.
所以,他们基本上做同样的事情。前者是 KVC 的做法。