I call ViewController as a popover when the user clicks a button. The view should have a black background with alpha 0.5. But the view is displayed like this for a second than the whole background turns black without alpha. Any idea why?
Here is my popover call:
let popOver = storyboard?.instantiateViewController(withIdentifier: "popOver") as! ViewControllerPopOver popOver.modalPresentationStyle = .popover self.present(popOver, animated: true, completion: nil)
I am trying to set the background color in popovers viewDidLoad() with the following code:
self.view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
source share