Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using blurred background in view with the storyboard in iOS

Tags:

ios

swift

uiview

(I am using Swift with iOS 8)

I am adding a (Sub)View to a UiViewController. This subview should hold a few UiLabels with some information in it. I want the subview to have a blurred background like the notification center of iOS has.

I know this is possible using UIEffectView, but how could I assign such a blurred effect using the storyboard? I actually don't want to create my views programmatically.

Thanks

like image 571
Christian Avatar asked Mar 30 '15 20:03

Christian


People also ask

How do you blur the background in iOS Swift?

In order for UIVisualEffectView to actually blur the content, its superview must be transparent. To make it transparent, change the background color of view to clear . Create a UIBlurEffect with a UIBlurEffect. Style.

How do I blur an image in Xcode?

To change an image, select a blur filter from the bar button item's menu of choices in the top right of the sample's navigation bar.


1 Answers

Yes this is possible in Xcode 6. Just search for "Visual Effect View with Blur" in the object library (bottom right). These can be added to your view controllers like any other view. You can also change the blur style in the attributes inspector (light, dark, extra light).

Hope this helps.

like image 175
David Yates Avatar answered Sep 23 '22 17:09

David Yates