diff --git a/pkg/apple/HelperBar/CocoaView+HelperBar.swift b/pkg/apple/HelperBar/CocoaView+HelperBar.swift index 483e428b91..3c7d58a427 100644 --- a/pkg/apple/HelperBar/CocoaView+HelperBar.swift +++ b/pkg/apple/HelperBar/CocoaView+HelperBar.swift @@ -50,6 +50,7 @@ extension CocoaView: HelperBarActionDelegate { } func orientationLockButtonTapped() { + #if TARGET_OS_IOS shouldLockCurrentInterfaceOrientation.toggle() if shouldLockCurrentInterfaceOrientation { let currentOrientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation ?? UIInterfaceOrientation.portrait @@ -58,6 +59,7 @@ extension CocoaView: HelperBarActionDelegate { if #available(iOS 16, *) { setNeedsUpdateOfSupportedInterfaceOrientations() } + #endif } var isKeyboardEnabled: Bool { diff --git a/ui/drivers/cocoa/cocoa_common.h b/ui/drivers/cocoa/cocoa_common.h index eadcd7546a..13cb0d5c59 100644 --- a/ui/drivers/cocoa/cocoa_common.h +++ b/ui/drivers/cocoa/cocoa_common.h @@ -68,8 +68,10 @@ @property(nonatomic,strong) UIView *helperBarView; #endif +#if TARGET_OS_IOS @property(readwrite) BOOL shouldLockCurrentInterfaceOrientation; @property(readwrite) UIInterfaceOrientation lockInterfaceOrientation; +#endif + (CocoaView*)get; @end