Last active
June 16, 2022 16:15
-
-
Save dimkagithub/0b607a33c8c4c51fe5928a5b94c1f8fc to your computer and use it in GitHub Desktop.
Blur View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var blurAnimator: UIViewPropertyAnimator! | |
let blurEffectView = UIVisualEffectView() | |
blurEffectView.backgroundColor = .clear | |
blurEffectView.frame = view.bounds | |
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] | |
blurAnimator?.stopAnimation(true) | |
blurAnimator?.finishAnimation(at: .current) | |
view.subMenuCollectionView.addSubview(blurEffectView) | |
blurAnimator = UIViewPropertyAnimator(duration: 1, curve: .linear) { [blurEffectView] in | |
blurEffectView.effect = UIBlurEffect(style: .dark) | |
} | |
blurAnimator.fractionComplete = 0.15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment