objective-cxcodeios8uipopovercontroller

UIPopoverPresentationController dimming background darker


I want darker background dim color for UIPopover. I know this can be achieved by subclassing UIPopoverBackgroundView as mentioned here but I am looking for any simpler way to do this.

P.S. I am using Objective C not Swift.


Solution

  • Swift 4

    I just came upon the same problem and found a solution similar to jimmyjudas.

    In the viewController displayed as a popover:

        override func viewWillAppear(_ animated: Bool) {
            super.viewWillAppear(animated)
            self.presentingViewController?.view.alpha = 0.3
        }
    
        override func viewWillDisappear(_ animated: Bool) {
            super.viewWillDisappear(animated)
            self.presentingViewController?.view.alpha = 1
        }