Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add visionOS support #2743

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RNGestureHandler.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/software-mansion/react-native-gesture-handler", :tag => "#{s.version}" }
s.source_files = "apple/**/*.{h,m,mm}"
s.requires_arc = true
s.platforms = { ios: apple_platform, tvos: apple_platform, osx: '10.15' }
s.platforms = { ios: apple_platform, tvos: apple_platform, osx: '10.15', visionos: '1.0' }

if defined?(install_modules_dependencies()) != nil
install_modules_dependencies(s);
Expand Down
2 changes: 1 addition & 1 deletion apple/Handlers/RNFlingHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ - (RNGestureHandlerEventExtraData *)eventExtraData:(id)_recognizer

CGPoint viewAbsolutePosition =
[recognizer.view convertPoint:recognizer.view.bounds.origin
toView:[UIApplication sharedApplication].keyWindow.rootViewController.view];
toView:RCTKeyWindow().rootViewController.view];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: check if it works on macOS

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It compiled so I assume it does

CGPoint locationInView = [recognizer getLastLocation];

return [RNGestureHandlerEventExtraData
Expand Down
2 changes: 1 addition & 1 deletion apple/Handlers/RNForceTouchHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ - (BOOL)shouldFail

- (void)performFeedbackIfRequired
{
#if !TARGET_OS_TV
#if !TARGET_OS_TV && !TARGET_OS_VISION
if (_feedbackOnActivation) {
if (@available(iOS 10.0, *)) {
[[[UIImpactFeedbackGenerator alloc] initWithStyle:(UIImpactFeedbackStyleMedium)] impactOccurred];
Expand Down
Loading