0

How is it possible to create a blur view on the first view controller in an iOS app? Like Xcode's blur view in the navigator blurring the desktop's background, I've recently recognized that Apple's 'Remote' App does the same on iOS (the background of the app is the blurred background image). Is this possible to achieve in any way using public API? Replacing the UIView by a UIBlurView only gives a gray background...

borchero
  • 5,562
  • 8
  • 46
  • 72

4 Answers4

1

Nobody who’s commented or answered here seems to realise that you want to blur the user’s own wallpaper and use that as the background for your root view controller, like what is achieved in Apple’s own apps (such as Remote).

While it may have been possible in earlier versions of iOS, it is currently not possible to achieve this effect in your own app using public APIs.

Community
  • 1
  • 1
Jack Greenhill
  • 10,240
  • 12
  • 38
  • 70
0

Add this below your view: (PS: I only know the obj-C version)

myView.backgroundColor = [UIColor clearColor];
UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:myView.frame];
bgToolbar.barStyle = UIBarStyleDefault;
[myView.superview insertSubview:bgToolbar belowSubview:myView];
Mohamad Bachir Sidani
  • 2,077
  • 1
  • 11
  • 17
0

UIVisualEffectView in iOS will give u blur effect when u will run your project in either simulator or device Otherwise in storyboard it will display as a simple UIView with a gray background...

U need to run it and then it will give a true blur effect.

have a look at the image below for better understanding.

have a look at an image for better understanding

Govind Prajapati
  • 957
  • 7
  • 24
  • I don't know if you understood what I meant .. I know how to use the blur view in generel, but I want to blur the background image of the phone .. not anything inside of my app – borchero Jul 26 '16 at 13:24
0

You could simply add one of the UIBlurEffectViews over the top of your UIImageView - the image view would be visible, blurred, through the blur view like below:

let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark)
let blurView = UIVisualEffectView(effect: blurEffect)
blurView.frame = yourFrame
imageView.addSubview(blurView)

Also you could remove the blurView using blurView.removeFromSuperview() or you can make it hidden blurView.hidden = true.

Santosh
  • 2,900
  • 1
  • 16
  • 16