fix(macOS): failing build due to missing TARGET_OS_OSX

This commit is contained in:
Samuel 2021-11-26 13:48:56 +01:00 committed by GitHub
parent 14cde20b24
commit 3d7b9cac6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -190,6 +190,7 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
return self; return self;
} }
#if !TARGET_OS_OSX
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
// Only allow long press gesture // Only allow long press gesture
if ([otherGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) { if ([otherGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {
@ -225,6 +226,8 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
} }
} }
#endif // !TARGET_OS_OSX
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
@ -433,7 +436,7 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
[self setKeyboardDisplayRequiresUserAction: _savedKeyboardDisplayRequiresUserAction]; [self setKeyboardDisplayRequiresUserAction: _savedKeyboardDisplayRequiresUserAction];
[self visitSource]; [self visitSource];
} }
#if !TARGET_OS_OSX
// Allow this object to recognize gestures // Allow this object to recognize gestures
if (self.menuItems != nil) { if (self.menuItems != nil) {
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(startLongPress:)]; UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(startLongPress:)];
@ -444,6 +447,7 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
longPress.cancelsTouchesInView = YES; longPress.cancelsTouchesInView = YES;
[self addGestureRecognizer:longPress]; [self addGestureRecognizer:longPress];
} }
#endif // !TARGET_OS_OSX
} }
// Update webview property when the component prop changes. // Update webview property when the component prop changes.