tvOS: Add target conditionals to fix tvOS build (#15637)

* Add target conditionals to fix tvOS build

* Use TARGET_OS_IOS for iOS
This commit is contained in:
yoshisuga 2023-08-22 11:55:59 -10:00 committed by GitHub
parent 34b71339de
commit 6b0a5c978e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -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 {

View File

@ -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