是否可以使用增强的密钥路径(如 here所述)为Swift 3中的CATransform3D属性添加新的#keyPath关键字? 换句话说就是替换 let scaleAnimation = CABasicAnimation(keyPath: "transform.scale") 喜欢的东西 let scaleA
换句话说就是替换
let scaleAnimation = CABasicAnimation(keyPath: "transform.scale")
喜欢的东西
let scaleAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.transform.???))应该使用CAValueFunction.
let scaleAnimation = CABasicAnimation(keyPath: "transform.scale")
– >
let scaleAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.transform)) scaleAnimation.valueFunction = CAValueFunction(name: kCAValueFunctionScale)
和
let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation")
– >
let rotationAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.transform)) rotationAnimation.valueFunction = CAValueFunction(name: kCAValueFunctionRotateZ)
等等
> rotation.x – > kCAValueFunctionRotateX> rotation.y – > kCAValueFunctionRotateY> rotation.z – > kCAValueFunctionRotateZ>旋转 – > kCAValueFunctionRotateZ> scale.x – > kCAValueFunctionScaleX> scale.y – > kCAValueFunctionScaleY> scale.z – > kCAValueFunctionScaleZ>规模 – > kCAValueFunctionScale> translation.x – > kCAValueFunctionTranslateX> translation.y – > kCAValueFunctionTranslateY> translation.z – > kCAValueFunctionTranslateZ>翻译 – > kCAValueFunctionTranslate