Post

Replies

Boosts

Views

Activity

Reply to Popovers are broken on Catalyst builds without portrait support
This is still a problem on Mac Catalyst 18.6 (macOS Sequoia 15.6). The original "Steps to Reproduce" from the original post are still valid and reproduce the issue. A simple code that shows the issue: class RootViewController { func presentPopup(action: UIAction) { if traitCollection.userInterfaceIdiom == .mac { let viewController = UIViewController() viewController.view.backgroundColor = .systemYellow viewController.preferredContentSize = CGSize(width: 300, height: 200) viewController.modalPresentationStyle = .popover viewController.popoverPresentationController?.sourceItem = action.sender as? UIPopoverPresentationControllerSourceItem viewController.popoverPresentationController?.delegate = self viewController.popoverPresentationController?.permittedArrowDirections = .up present(viewController, animated: true) } } } extension RootViewController: UIPopoverPresentationControllerDelegate { func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle { return .none } } Once you add Portrait as a supported orientation under the iPad Orientation, it works. Another, unrelated issue, is that you get three warnings when the controller is presented: UIScene property of UINSSceneViewController was accessed before it was set. UIScene property of UINSSceneViewController was accessed before it was set. UIScene property of UINSSceneViewController was accessed before it was set. However the warnings don't affect the popup functionality.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’25