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 #3373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know this stuff very well, so drive by comment on something that looks funky
EDIT: And ported. Good to go! This PR works as far as I can tell, save custom menus. The method for showing custom actions in a context menu on iOS 16 / visionOS 1.0 changed (use |
if (@available(iOS 16.0, *)) { | ||
CGPoint location = [pressSender locationInView:self]; | ||
UIEditMenuConfiguration *config = [UIEditMenuConfiguration configurationWithIdentifier:nil sourcePoint:location]; | ||
[_editMenuInteraction presentEditMenuWithConfiguration:config]; | ||
} else { | ||
// When a long press ends, bring up our custom UIMenu if defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need to support older versions of Xcode, I can put this behind a compiler macro like we do elsewhere, along with any other references.
Hello @Titozzz / @jamonholmgren , I was wondering if there was anything I could do to help move this PR forward? Appreciate your time spent maintaining this repo :) |
🎉 This PR is included in version 13.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Add visionOS support, and an example test app via react-native-test-app.
As it turns out, most of where we ifdeffed stuff out for macOS, is also where we need to ifdef out for visionOS. So a simple conversion of the ifdefs from "if !macOS" to "if iOS" does the job.
Additionally, we needed to port uses of
UIMenuController
to toUIEditMenuInteraction
. This is only available on iOS 16+, so I did my best to guard behind availability checks and compiler ifdefs. I am not sure what our minimum iOS/Xcode version we want to support in this repo is, so I would appreciate a sanity check.Test Plan
Test app works. Custom menus work on both iOS 16 and visionOS 1.0
(Sorry for the compressed video)
Screen.Recording.2024-04-02.at.1.27.14.PM_compressed.mp4