Can you give me a code sample with the new stuff in visionOS

Generated on 5/1/2025

1 search

To explore the new features in visionOS, particularly for Vision Pro, you can refer to the session titled "Platforms State of the Union" where they discuss enhancements in scene understanding, object tracking, and more. For a detailed look at the new APIs and capabilities, the session "Introducing enterprise APIs for visionOS" provides insights into enhanced sensor access and object tracking.

Here's a brief code sample to get you started with the new object tracking API in visionOS:

import VisionOS

// Initialize the object tracking session
let objectTrackingSession = VNObjectTrackingSession()

// Configure the session with known objects
objectTrackingSession.configure(with: [
    VNKnownObject(identifier: "exampleObject", referenceImage: UIImage(named: "exampleImage")!)
])

// Start the session
objectTrackingSession.start()

// Handle detected objects
objectTrackingSession.didDetectObjects = { detectedObjects in
    for object in detectedObjects {
        print("Detected object: \(object.identifier) at position: \(object.position)")
    }
}

This code demonstrates how to set up an object tracking session using the new APIs in visionOS. You can adjust parameters such as the maximum number of objects tracked or the tracking rate to suit your application's needs.

For more detailed information, you can watch the session Introducing enterprise APIs for visionOS (02:36) which covers enhanced sensor access and other new features.

Discover Swift enhancements in the Vision framework

Discover Swift enhancements in the Vision framework

The Vision Framework API has been redesigned to leverage modern Swift features like concurrency, making it easier and faster to integrate a wide array of Vision algorithms into your app. We’ll tour the updated API and share sample code, along with best practices, to help you get the benefits of this framework with less coding effort. We’ll also demonstrate two new features: image aesthetics and holistic body pose.

Bring your iOS or iPadOS game to visionOS

Bring your iOS or iPadOS game to visionOS

Discover how to transform your iOS or iPadOS game into a uniquely visionOS experience. Increase the immersion (and fun factor!) with a 3D frame or an immersive background. And invite players further into your world by adding depth to the window with stereoscopy or head tracking.

Introducing enterprise APIs for visionOS

Introducing enterprise APIs for visionOS

Find out how you can use new enterprise APIs for visionOS to create spatial experiences that enhance employee and customer productivity on Apple Vision Pro.

What’s new in device management

What’s new in device management

Learn about the latest management capabilities for iOS, iPadOS, macOS, and visionOS, then discover the latest changes to Apple Business Manager and Apple School Manager. We’ll also share updates to Activation Lock, SoftwareUpdate, and Safari management.

Create enhanced spatial computing experiences with ARKit

Create enhanced spatial computing experiences with ARKit

Learn how to create captivating immersive experiences with ARKit’s latest features. Explore ways to use room tracking and object tracking to further engage with your surroundings. We’ll also share how your app can react to changes in your environment’s lighting on this platform. Discover improvements in hand tracking and plane detection which can make your spatial experiences more intuitive.

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 machine learning on Apple platforms

Explore machine learning on Apple platforms

Get started with an overview of machine learning frameworks on Apple platforms. Whether you’re implementing your first ML model, or an ML expert, we’ll offer guidance to help you select the right framework for your app’s needs.

Platforms State of the Union

Platforms State of the Union

Discover the newest advancements on Apple platforms.

Design great visionOS apps

Design great visionOS apps

Find out how to create compelling spatial computing apps by embracing immersion, designing for eyes and hands, and taking advantage of depth, scale, and space. We’ll share several examples of great visionOS apps and explore how their designers approached creating new experiences for the platform.

Platforms State of the Union 5-Minute Recap

Platforms State of the Union 5-Minute Recap

Watch a quick recap of the newest advancements on Apple platforms.

Optimize for the spatial web

Optimize for the spatial web

Discover how to make the most of visionOS capabilities on the web. Explore recent updates like improvements to selection highlighting, and the ability to present spatial photos and panorama images in fullscreen. Learn to take advantage of existing web standards for dictation and text-to-speech with WebSpeech, spatial soundscapes with WebAudio, and immersive experiences with WebXR.