uiviewpropertyanimator

Animate the fractionComplete of UIViewPropertyAnimator for blurring the background

依然范特西╮ 提交于 2019-12-01 18:26:04
So I'm using the new UIViewPropertyAnimator and UIVisualEffectView to achieve the same thing as the Spotlight search when you scrolling down on the home screen and it blurs the background. I'm using the fractionComplete property to set the procent of how much to blur when panning a UIView. animator = UIViewPropertyAnimator(duration: 1, curve: .linear) { self.blurEffectView.effect = nil } And the amount of blurriness is changed with a value between 0.0 - 1.0. animator?.fractionComplete = blurValue But when I cancel the pan gesture I want the blur to animate back from where it is to no blur (e.g

Animate the fractionComplete of UIViewPropertyAnimator for blurring the background

余生长醉 提交于 2019-12-01 04:03:50
问题 So I'm using the new UIViewPropertyAnimator and UIVisualEffectView to achieve the same thing as the Spotlight search when you scrolling down on the home screen and it blurs the background. I'm using the fractionComplete property to set the procent of how much to blur when panning a UIView. animator = UIViewPropertyAnimator(duration: 1, curve: .linear) { self.blurEffectView.effect = nil } And the amount of blurriness is changed with a value between 0.0 - 1.0. animator?.fractionComplete =