From 82bde29960ce90c7ff605c20fe50e3f3e613522b Mon Sep 17 00:00:00 2001 From: Levin Li Date: Sun, 18 Feb 2024 15:29:02 +0800 Subject: [PATCH] Fix crash --- MobileCelestia.xcodeproj/project.pbxproj | 4 ++-- MobileCelestia/MainViewController.swift | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MobileCelestia.xcodeproj/project.pbxproj b/MobileCelestia.xcodeproj/project.pbxproj index 99fc8bc2..f1b037c4 100644 --- a/MobileCelestia.xcodeproj/project.pbxproj +++ b/MobileCelestia.xcodeproj/project.pbxproj @@ -1649,7 +1649,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.15; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SHARED_BUILD_NUMBER = 453; + SHARED_BUILD_NUMBER = 454; SHARED_BUILD_VERSION = 1.6.9; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -1706,7 +1706,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.1; MACOSX_DEPLOYMENT_TARGET = 10.15; SDKROOT = iphoneos; - SHARED_BUILD_NUMBER = 453; + SHARED_BUILD_NUMBER = 454; SHARED_BUILD_VERSION = 1.6.9; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; diff --git a/MobileCelestia/MainViewController.swift b/MobileCelestia/MainViewController.swift index 00cafb41..231eb65a 100644 --- a/MobileCelestia/MainViewController.swift +++ b/MobileCelestia/MainViewController.swift @@ -600,6 +600,14 @@ extension MainViewController: CelestiaControllerDelegate { } func celestiaControllerRequestShowActionMenu(_ celestiaController: CelestiaViewController) { + #if targetEnvironment(macCatalyst) + if #available(iOS 14, *) { + split?.preferredDisplayMode = .oneBesideSecondary + return + } + #endif + guard presentedViewController != actionViewController, !actionViewController.isBeingPresented else { return } + actionViewController.modalPresentationStyle = .custom actionViewController.transitioningDelegate = toolbarSlideInManager presentAfterDismissCurrent(actionViewController, animated: true)