Search code examples
iosmac-catalystuitraitcollectionuipopoverpresentationcontroller

Horizontal size class of popovers in Catalyst?


If I present a view controller as a popover on iPad (by setting its modalPresentationStyle to .popover), it will report its horizontal size class as .compact. But if I run the same code in a Catalyst app, the view controller in the popover reports a horizontal size class of .regular. Compact is what I expect. Setting overrideTraitCollection on the popoverPresentationController of the view controller before I present it works to make the size class regular on iPad, but it won't make it compact on Catalyst.

How can I make a view controller in a popover correctly report a compact horizontal size class in Catalyst?


Solution

  • I asked an Apple engineer this in a WWDC 2021 lab on Catalyst and he said it's a bug. I've filed it as Feedback FB9124431.