I am using a popover view controller where I don't want the popover to cover the full screen (iOS 13). I was trying to use:
func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return .none
}
The method was being called but the popover displayed was always full screen, even though a smaller preferred content size was being specified. After a lot of time trying many different things I found that there is another method which has 2 parameters and used it:
func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {
return .none
}
Using this method makes the popover screen be the specified size. Anybody have an idea why the second one would work and the first one won't. I have a couple other apps in which I am using the first one with no issues, what gives?!!