user1655244
user1655244

Reputation: 31

How do I get the the screen to Blur when presenting a popover in iOS 8

During the talk "ViewController Advancements in iOS8" at WWDC 2014, on slide #114 it shows how the PresentationController can provide a 'dimming view' when a Popover slides up from the bottom when displayed on an iPhone. It doesn't look like the source code for example in the talk is available.

The effect I want is very simple: when a popover slides up, the background of the popover is a blurred 'screen shot' of the contents behind it. The look I am going for is on slide #162. On slide #154 it indicates that the method 'adaptivePresentationStyleForPresentationController' can be used to add a UIVisualEffectView to the 'presented view controller' to get the desired effect.

I have not been able to find a simple Objective-C example showing how this would be done.

Upvotes: 3

Views: 3180

Answers (1)

zooster
zooster

Reputation: 352

You can add it to your presenting VC before performing the segue to the overlay VC, as follows:

    let blurView = UIVisualEffectView(effect: UIBlurEffect(style: UIBlurEffectStyle.ExtraLight))
    blurView.frame = self.view.bounds
    self.view.addSubview(blurView)

Upvotes: 4

Related Questions