1
UIViewPropertyAnimator
でユーザーインタラクティブアニメーションを利用したい場合は、オブジェクトを時計回りに360度アニメーションしますか? (少しハックされていない場合?)UIViewPropertyAnimatorを使って360度回転する方法
// Does not animate
let animator = UIViewPropertyAnimator(duration: 2, curve: .linear) {
let radians = Angle(360).radians // 6.28318530717959
view.transform = view.transform.rotated(by: CGFloat(radians))
}
// (Using RxSwift to handle the user interaction via UISlider,
// but that can be ignored as an implementation detail for this question.)
let scrubs = slider.rx.value.asDriver()
scrubs.drive(onNext: { (value:Float) -> Void in
animator.fractionComplete = CGFloat(value)
})