Skip to content

Instantly share code, notes, and snippets.

@dimkagithub
Last active June 16, 2022 16:15
Show Gist options
  • Save dimkagithub/0b607a33c8c4c51fe5928a5b94c1f8fc to your computer and use it in GitHub Desktop.
Save dimkagithub/0b607a33c8c4c51fe5928a5b94c1f8fc to your computer and use it in GitHub Desktop.
Blur View
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