我目前正在 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:两个 CAAnimation 禁用之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47247495/