UIPopoverPresentationController darkening background darker
3 answers
Swift 4
I just ran into the same problem and found a solution similar to jimmyjudas.
The viewController is 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
}
+1
source to share
UIPopover does not have a background property because the NSObject subclass has no view property setting so you can change the color of your content -
UIPopoverController *popC = [[UIPopoverController alloc] initWithContentViewController:TestingPC];
[[[popC contentViewController] view] setBackgroundColor:[UIColor blackcolor]];
0
source to share