Skip to content

Commit 5f6dbf7

Browse files
authored
Fix tvOS build (#3180)
## Description After adding `stylusData` support, builds on `tvOS` fail. This PR fixes that ## Test plan Add Gesture Handler to tvOS app (for example run `npx @react-native-community/cli@latest init TVTest --template @react-native-tvos/template-tv`) and check that it builds correctly.
1 parent 275ff51 commit 5f6dbf7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apple/Handlers/RNPanHandler.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,13 @@ - (RNGestureHandlerEventExtraData *)eventExtraData:(UIPanGestureRecognizer *)rec
464464
withVelocity:[recognizer velocityInView:recognizer.view.window]
465465
withNumberOfTouches:recognizer.numberOfTouches
466466
withPointerType:_pointerType
467+
#if !TARGET_OS_TV
467468
withStylusData:[panRecognizer.stylusData toDictionary]]; // In Objective-C calling method on nil returns
468469
// nil, therefore this line does not crash.
470+
#else
471+
withStylusData:nil];
472+
#endif // TARGET_OS_TV
469473
}
470-
#endif
474+
#endif // TARGET_OS_OSX
471475

472476
@end

0 commit comments

Comments
 (0)