以前在swift中你可以这样做:
let animator = UIViewPropertyAnimator(duration: 0.25, curve: .easeIn) {
UIView.setAnimationRepeatCount(Float.infinity)
UIView.setAnimationRepeatAutoreverses(true)
let transform = CATransform3DIdentity
let rotate = CATransform3DRotate(transform, 45, 1, 1, 0)
self.ex.layer.transform = rotate
}
UIView.setAnimationRepeatCount
但是,现在和上有一条弃用消息UIView.setAnimationRepeatAutoreverses
。有人知道他们被什么替换了吗?我还能用UIViewPropertyAnimator
吗,还是我必须去类似的东西CABasicAnimation
?
消息是:
'setAnimationRepeatCount' 在 iOS 13.0 中已弃用:改用基于块的动画 API
'setAnimationRepeatAutoreverses' 在 iOS 13.0 中已弃用:改用基于块的动画 API