Post

Replies

Boosts

Views

Activity

Reply to UIAlertController no longer appears as a popover in macOS Sonoma
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
Nov ’23