I'm trying to animate a layer's shadowPath
property using UIViewPropertyAnimator
but it looks like it's getting instantaneously set (instead of animating or being able to set the fraction complete on the animation.)
Is there an alternative way to do this?
view.layer.shadowPath = UIBezierPath(roundedRect: .init(origin: .zero, size: .init(width: 100, height: 100)), cornerRadius: 12).cgPath
let animator = UIViewPropertyAnimator(duration: 2.0, curve: .easeInOut) {
view.layer.shadowPath = UIBezierPath(roundedRect: .init(origin: .zero, size: .init(width: 200, height: 200)), cornerRadius: 12).cgPath
}
animator.scrubsLinearly = false
animator.pauseAnimation()
animator.fractionComplete = 0