Skip to content

Commit

Permalink
fix(macOS): failing build due to missing TARGET_OS_OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelScheit committed Nov 26, 2021
1 parent 14cde20 commit 3d7b9ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apple/RNCWebView.m
Expand Up @@ -190,6 +190,7 @@ - (instancetype)initWithFrame:(CGRect)frame
return self;
}

#if !TARGET_OS_OSX
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
// Only allow long press gesture
if ([otherGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {
Expand Down Expand Up @@ -225,6 +226,8 @@ - (void)startLongPress:(UILongPressGestureRecognizer *)pressSender
}
}

#endif // !TARGET_OS_OSX

- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
Expand Down Expand Up @@ -433,7 +436,7 @@ - (void)didMoveToWindow
[self setKeyboardDisplayRequiresUserAction: _savedKeyboardDisplayRequiresUserAction];
[self visitSource];
}

#if !TARGET_OS_OSX
// Allow this object to recognize gestures
if (self.menuItems != nil) {
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(startLongPress:)];
Expand All @@ -444,6 +447,7 @@ - (void)didMoveToWindow
longPress.cancelsTouchesInView = YES;
[self addGestureRecognizer:longPress];
}
#endif // !TARGET_OS_OSX
}

// Update webview property when the component prop changes.
Expand Down

0 comments on commit 3d7b9ca

Please sign in to comment.