visionOS: Don't use deprecated UI for scene placement

This commit is contained in:
Shadowfacts 2024-02-04 11:46:04 -05:00
parent 4500e9be27
commit ec0509c645
1 changed files with 4 additions and 0 deletions

View File

@ -437,7 +437,11 @@ extension MenuActionProvider {
private func addOpenInNewWindow(actions: inout [UIAction], activity: @escaping @autoclosure () -> NSUserActivity) { private func addOpenInNewWindow(actions: inout [UIAction], activity: @escaping @autoclosure () -> NSUserActivity) {
let options = UIWindowScene.ActivationRequestOptions() let options = UIWindowScene.ActivationRequestOptions()
#if os(visionOS)
options.placement = .standard()
#else
options.preferredPresentationStyle = .automatic options.preferredPresentationStyle = .automatic
#endif
actions.append(UIWindowScene.ActivationAction { (_) in actions.append(UIWindowScene.ActivationAction { (_) in
let activity = activity() let activity = activity()
activity.displaysAuxiliaryScene = true activity.displaysAuxiliaryScene = true