I think this is new in iOS9, but you can now set the effect of a UIVisualEffectView
inside an animation block:
let overlay = UIVisualEffectView()
// Put it somewhere, give it a frame...
UIView.animate(withDuration: 0.5) {
overlay.effect = UIBlurEffect(style: .light)
}
Set it to nil
to remove.
VERY IMPORTANT – When testing this on the simulator, make sure to set your simulator’s Graphics Quality Override to High Quality in order for this to work.