Created
June 8, 2017 12:37
-
-
Save barbaramartina/579249bcfd1638bb3ce13a783e028ccf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// iOS 10 working way to fade in a blurred view (changing alpha in the container does not work on iOS 10) | |
let effectView = UIVisualEffectView() | |
effectView.frame = toast.bounds | |
effectView.autoresizingMask = [.flexibleWidth, .flexibleHeight] | |
view.addSubview(effectView) //replace view with whatever view you want to blur | |
UIView.animate(withDuration: 0.2) { | |
let blur = UIBlurEffect(style: .light) | |
effectView.effect = blur | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment