diff --git a/app/os_ios.go b/app/os_ios.go index 34163e63..3da86071 100644 --- a/app/os_ios.go +++ b/app/os_ios.go @@ -21,6 +21,7 @@ struct drawParams { }; static void writeClipboard(unichar *chars, NSUInteger length) { +#if !TARGET_OS_TV @autoreleasepool { NSString *s = [NSString string]; if (length > 0) { @@ -29,13 +30,18 @@ static void writeClipboard(unichar *chars, NSUInteger length) { UIPasteboard *p = UIPasteboard.generalPasteboard; p.string = s; } +#endif } static CFTypeRef readClipboard(void) { +#if !TARGET_OS_TV @autoreleasepool { UIPasteboard *p = UIPasteboard.generalPasteboard; return (__bridge_retained CFTypeRef)p.string; } +#else + return nil; +#endif } static void showTextInput(CFTypeRef viewRef) { diff --git a/app/os_ios.m b/app/os_ios.m index 1c3fe58f..de57aaa5 100644 --- a/app/os_ios.m +++ b/app/os_ios.m @@ -26,12 +26,13 @@ CGFloat _keyboardHeight; self.view.layoutMargins = UIEdgeInsetsMake(0, 0, 0, 0); UIView *drawView = [[GioView alloc] initWithFrame:zeroFrame]; [self.view addSubview: drawView]; -#ifndef TARGET_OS_TV +#if !TARGET_OS_TV drawView.multipleTouchEnabled = YES; #endif drawView.preservesSuperviewLayoutMargins = YES; drawView.layoutMargins = UIEdgeInsetsMake(0, 0, 0, 0); onCreate((__bridge CFTypeRef)drawView, (__bridge CFTypeRef)self); +#if !TARGET_OS_TV [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChange:) name:UIKeyboardWillShowNotification @@ -44,6 +45,7 @@ CGFloat _keyboardHeight; selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; +#endif [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationDidEnterBackground:) name: UIApplicationDidEnterBackgroundNotification @@ -89,6 +91,7 @@ CGFloat _keyboardHeight; [super didReceiveMemoryWarning]; } +#if !TARGET_OS_TV - (void)keyboardWillChange:(NSNotification *)note { NSDictionary *userInfo = note.userInfo; CGRect f = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; @@ -100,6 +103,7 @@ CGFloat _keyboardHeight; _keyboardHeight = 0.0; [self.view setNeedsLayout]; } +#endif @end static void handleTouches(int last, GioView *view, NSSet *touches, UIEvent *event) {