UIAlertController no longer appears as a popover in macOS Sonoma

Prior to macOS 14, a Catalyst app could present a UIAlertController as a popover, just as you can on the iPad. While this still works on the iPad, the presentation on macOS now uses the same style as the iPhone.

The UIAlertController's popoverPresentationController property is always nil, no matter how it is configured.

Doe anyone know of a way to restore the prior behavior under Sonoma?

I am having the same issue. Has anyone figured out a fix for this yet?

I’m having the same problem for Mac Catalyst with Apple silicon, macOS Sonoma 14.1, Xcode 15.0.1. It still works as expected on Intel, macOS Monterey 12.7, Xcode 14.2.

In Xcode 15, I noticed that attempting to set modalPresentationStyle on the UIAlertController to .popover has no effect. It remains its default, .custom, so a UIPopoverPresentationController is not created in the alert controller. The expected popover behavior works fine for view controllers of other types.

I prefer to get UIAlertControllers working again, but in the meantime I created a simple action sheet-style VC that I use as a replacement for actionSheet-popover UIAlertControllers with Mac Catalyst. Like so…

#if targetEnvironment(macCatalyst)
        let alert = SimpleActionSheetVC()
        …
#else
        let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
        …
#endif

I was told the change in behavior for Catalyst is by design. To me, since it worked before and still works this way on the iPad, this is a regression.

UIAlertController no longer appears as a popover in macOS Sonoma
 
 
Q