Make UIViewPropertyAnimator never terminate
Description of the problem
I have a UIViewPropertyAnimator
blur control, by the way, and I would only like to use it for its property fractionComplete
. The problem is, if I set fractionComplete
to 1.0
, it terminates and removes any animations that I would like to keep.
Basically, I don't want the animator to end because it clears its animation blocks.
Workarounds considered
- Re-add animation when finished
- Clamp
fractionComplete
to something like0.001...0.999
source to share
Now with iOS11 you can install
var pausesOnCompletion: Bool { get set }
on the UIViewPropertyAnimator
When the value of this property is true, the animator remains active when the animation ends, and it does not complete its completion handler. Keeping the animator active allows you to cancel the animation even after it has finished. When the value of this property is false, the animator will automatically go dormant when the animation ends, thereby ending the animation. The default value for this property is false.
source: https://developer.apple.com/documentation/uikit/uiviewpropertyanimator/2909004-pausesoncompletion
source to share