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? this tap is on a button thats on flat UI displayed in a volumetric window

Generated on 8/8/2024

1 search

It sounds like your tap gesture on a button in a VGrid within a volumetric window in visionOS 2 isn't working as expected. Here are a few things you might want to check based on the information from WWDC sessions:

  1. Input Target and Collision Components: Ensure that your button has both an input target component and a collision component. These are necessary for the entity to be tappable in visionOS. You can find more details on this in the session Explore game input in visionOS.

  2. Gesture Attachment: Make sure that the gesture is attached to the reality view that contains your entities. This is crucial for the gesture to be recognized and handled correctly. More information can be found in the same session Explore game input in visionOS.

  3. System Gestures: If you are using system gestures, ensure that they are correctly implemented. System gestures are supported across all spaces in visionOS, and they should work out of the box if implemented correctly. Refer to the session Explore game input in visionOS for more details.

  4. Custom Gestures: If you are using custom gestures, ensure that they are correctly defined and that all necessary joints for hand tracking are being checked. This is especially important if your app is in a full space where ARKit and hand tracking are available. You can find more information on creating custom gestures in the session Explore game input in visionOS.

  5. SwiftUI and UIKit Coordination: If your app uses both SwiftUI and UIKit, ensure that the gesture recognizers are coordinated properly. You can set failure requirements between gesture recognizers to ensure they don't interfere with each other. More details can be found in the session What’s new in UIKit.

By checking these aspects, you should be able to identify and resolve the issue with your tap gesture. If the problem persists, you might want to review the relevant WWDC sessions in more detail or consult the official documentation for further guidance.

Explore object tracking for visionOS

Explore object tracking for visionOS

Find out how you can use object tracking to turn real-world objects into virtual anchors in your visionOS app. Learn how you can build spatial experiences with object tracking from start to finish. Find out how to create a reference object using machine learning in Create ML and attach content relative to your target object in Reality Composer Pro, RealityKit or ARKit APIs.

Get started with HealthKit in visionOS

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.

Explore game input in visionOS

Explore game input in visionOS

Discover how to design and implement great input for your game in visionOS. Learn how system gestures let you provide frictionless ways for players to interact with your games. And explore best practices for supporting custom gestures and game controllers.

Discover RealityKit APIs for iOS, macOS and visionOS

Discover RealityKit APIs for iOS, macOS and visionOS

Learn how new cross-platform APIs in RealityKit can help you build immersive apps for iOS, macOS, and visionOS. Check out the new hover effects, lights and shadows, and portal crossing features, and view them in action through real examples.

What’s new in watchOS 11

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

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.