0

I want to copy the blur effect in the red box:

enter image description here

You see that the photo is somehow in the background of this rectangle. I found this effect in apps like Eye'em and Spotify.

How can I make such a blur effect?

  • possible duplicate of [iOS 7 style Blur view](http://stackoverflow.com/questions/17036655/ios-7-style-blur-view) – Luke May 25 '15 at 12:20
  • @Luke No this is something different! –  May 25 '15 at 13:53
  • can you clarify the type of blur you are looking for? UIVisualEffectView from the answers to the other question provides both bright and dark blurs – Luke May 25 '15 at 13:56
  • this already has some answers on how to achieve this blur, hope this helps http://stackoverflow.com/questions/17036655/ios-7-style-blur-view – Luke May 25 '15 at 21:23
  • I don't actually see anything in the highlighted rectangle. It looks black to me. – Sulthan May 26 '15 at 14:29

2 Answers2

3

The example bellow create a view with blur effect in the top part of the screen, basically you create a view (or use an existent one), create a blur effect, resize the effect to fit the view and add the new view with the effect to the first view.

var myViewToBlur = UIView(frame: CGRectMake(0, 0, self.view.frame.width, 100))
let blurView = UIVisualEffectView(effect:UIBlurEffect(style: UIBlurEffectStyle.Light))
blurView.frame = myViewToBur.bounds
myViewToBur.addSubview(blurView)
ABakerSmith
  • 22,759
  • 9
  • 68
  • 78
Icaro
  • 14,585
  • 6
  • 60
  • 75
  • 2
    One think to remember, this is only available in iOS 8 and not for all devices that support iOS 8. Since some devices don't have the hardware to support the blur effect. There is an accessibility option that turns off blur effects. – Tobias May 24 '15 at 20:30
1

Here is a great article that is covering several options for this effect.

http://code.tutsplus.com/tutorials/adding-blur-effects-on-ios--cms-21488

It covers 3 techniques:

  • blurring with the Core Image framework
  • blurring using Brad Larson's GPUImage framework
  • blurring using Apple's UIImage+ImageEffects category

You can even get some working code here: https://github.com/iGriever/TWSReleaseNotesView

BR, ValR.

valR
  • 829
  • 7
  • 13