i upgraded my app to use visionos2 sdk. but now my tap wont work on a button in a vgrid, any ideas what might have messed up my tap gesture?
Asked on 08/08/2024
1 search
It sounds like your tap gesture might not be working due to some changes in how gestures are handled in visionOS 2. Here are a few things you can check based on the information from WWDC sessions:
-
Input Target and Collision Component: Ensure that any entities you want to be tappable have both an input target component and a collision component. This is necessary for the system to recognize tap gestures on those entities.
-
Gesture Attachment: Make sure that the gesture is attached to the reality view that contains your entities. This allows the system to detect and respond to the gesture appropriately.
-
Gesture Recognizers Coordination: If you are using both UIKit and SwiftUI, ensure that the gesture recognizers are coordinated properly. In iOS 18, you can specify dependencies between gestures across both frameworks to prevent conflicts.
-
System Gestures: VisionOS supports a variety of system gestures, including single tap, double tap, pinch and hold, and pinch and drag. Ensure that your app is correctly set up to respond to these gestures.
By verifying these aspects, you should be able to identify and resolve the issue with your tap gesture in the VGrid. If you need more detailed guidance, you might want to refer to the full session on Explore game input in visionOS.

What’s new in watchOS 11
Explore new opportunities on Apple Watch, including bringing Double Tap support to your watchOS app, making your Smart Stack widgets even more relevant and interactive, and displaying your iOS Live Activities in the Smart Stack.

What’s new in UIKit
Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.

Get started with HealthKit in visionOS
Discover how to use HealthKit to create experiences that take full advantage of the spatial canvas. Learn the capabilities of HealthKit on the platform, find out how to bring an existing iPadOS app to visionOS, and explore the special considerations governing HealthKit during a Guest User session. You’ll also learn ways to use SwiftUI, Swift Charts, and Swift concurrency to craft innovative experiences with HealthKit.