我正在尝试制作与视频转换有关的应用程序。我已经使用CABasicAnimation
来旋转CaLayer
。它使我旋转。我希望CaLayer
沿yhr X轴垂直旋转。我该怎么办?
let rotationAnimationx = CABasicAnimation(keyPath: "transform.rotation.x")
rotationAnimationx.fromValue = 0
rotationAnimationx.byValue = Double.pi * 2
rotationAnimationx.duration = 3
rotationAnimationx.beginTime = CFTimeInterval(time[image])
rotationAnimationx.fillMode = CAMediaTimingFillMode.forwards
rotationAnimationx.isRemovedOnCompletion = false
blackLayer.add(rotationAnimationx, forKey: "transform.rotation.x")