Opacity only works for a moment when modally presenting a UIPageViewController

26 Views Asked by At

I have a modal segue to a UIPageViewController.

I would like the background of the UIPageViewController to be clear. I have set this in the viewDidLoad(), and have set the custom view controller for the page view controller to have a dark grey background with 0.98 opacity.

When the segue pops up, the 0.98 opacity works for about a second and then goes opaque.

I've tried both full screen and current context presentation styles, and tried swapping so that it's background = .clear in the custom view controller / opacity 0.98 in the page view controller.

Any ideas?

1

There are 1 best solutions below

0
Lena Verhoev On BEST ANSWER
  • Changed segue presentation to automatic
  • view.backgroundColor = .clear in UIPageViewController viewDidLoad()
  • backgroundColor = .clear and opacity in the custom View Controller viewDidLoad()