Title pretty much asks it all...
I\'m playing with the iOS8 Visual Effect View with Blur
. It\'s over a UIImageView
that shows a user choosa
This works for me.
I put UIVisualEffectView
in an UIView
before add to my view.
I make this function to use easier. You can use this function to make blur any area in your view.
func addBlurArea(area: CGRect, style: UIBlurEffectStyle) {
let effect = UIBlurEffect(style: style)
let blurView = UIVisualEffectView(effect: effect)
let container = UIView(frame: area)
blurView.frame = CGRect(x: 0, y: 0, width: area.width, height: area.height)
container.addSubview(blurView)
container.alpha = 0.8
self.view.insertSubview(container, atIndex: 1)
}
For example, you can make blur all of your view by calling:
addBlurArea(self.view.frame, style: UIBlurEffectStyle.Dark)
You can change Dark
to your desired blur style and 0.8
to your desired alpha value