Reputation: 31
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
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