1

I have been trying to figure out how to create a popover view or view controller (not sure which one to use) over my main view controller. I want the popover to act how the device notification center window acts. I don't necessarily want it to be a drag down, but when I click a button I want the window to display over the whole main view controller with a slightly transparent view similar to the notification center. The idea is, I would like to see the "blurred" content through the new window. Any ideas on what I should do to achieve this?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Electric
  • 115
  • 10
  • Possible duplicate of [How to customize / style a UIPopoverController](http://stackoverflow.com/questions/2552686/how-to-customize-style-a-uipopovercontroller) – Mayank Patel Dec 12 '15 at 11:34
  • Possible duplicate of [Transparent UIPopover](http://stackoverflow.com/questions/4678456/transparent-uipopover) – Ali Beadle Feb 04 '17 at 15:39

1 Answers1

-3

When you present a UIViewController (yourVC) with a modalPresentationStyle = .Popover, UIKit creates an instance of the UIPopoverPresentationController class automatically. You can set properties for this view controller as yourVC.popoverPresentationController?.

If you set yourVC.popoverPresentationController?.backgroundColor = UIColor.clearColor(), then you will get a transparent blur effect.

Good explanation can be found in Apple's documentation for UIPopoeverPresentationController.

Pang
  • 9,564
  • 146
  • 81
  • 122