WWDC24

View sample code referenced in the WWDC24 session videos.

Featured
  • Destination Video

    Leverage SwiftUI to build an immersive media experience in a multiplatform app.

    iOS, iPadOS, macOS, tvOS, visionOS

    View code
  • BOT-anist

    Build a multiplatform app that uses windows, volumes, and animations to create a robot botanist's greenhouse.

    iOS, iPadOS, macOS, visionOS

    View code
Accessibility
  • Enhancing the accessibility of your SwiftUI app

    Support advancements in SwiftUI accessibility to make your app accessible to everyone.

    iOS macOS

    View code
App Intents
  • Making your app’s functionality available to Siri

    Add assistant schemas to your app so Siri can complete requests, and integrate your app with Apple Intelligence, Spotlight, and other system experiences.

    iOS macOS

    View code
ARKit
  • Building local experiences with room tracking

    Use room tracking in visionOS to provide custom interactions with physical spaces.

    visionOS

    View code
  • Exploring object tracking with ARKit

    Find and track real-world objects in visionOS using reference objects trained with Create ML.

    visionOS

    View code
Audio and video
  • Capturing system audio with Core Audio taps

    Use a Core Audio tap to capture outgoing audio from a process or group of processes.

    macOS

    View code
  • Generating spatial audio from a multichannel audio stream

    Convert 8-channel audio to 2-channel spatial audio by using a spatial mixer audio unit.

    iOS macOS

    View code
  • Converting side-by-side 3D video to multiview HEVC and spatial video

    Create video content for visionOS by converting an existing 3D HEVC file to a multiview HEVC format, optionally adding spatial metadata to create a spatial video.

    macOS

    View code
  • Providing an integrated view of your timeline when playing HLS interstitials

    Go beyond simple ad insertion with point and fill occupancy HLS interstitials.

    iOS

    View code
  • Creating a MIDI device driver

    Implement a configurable virtual MIDI driver as a driver extension that runs in user space in macOS and iPadOS.

    iOS macOS DriverKit

    View code
Bluetooth
  • Authorizing a Bluetooth accessory to share a dice roll

    Discover and set up a specific Bluetooth accessory without requesting permission to use Bluetooth.

    iOS

    View code
Contacts
  • Accessing a person’s contact data using Contacts and ContactsUI

    Allow people to grant your app access to contact data by adding the Contact access button and Contact access picker to your app.

    iOS

    View code
Core ML
  • Integrating a Core ML Model into Your App

    Add a simple model to an app, pass input data to the model, and process the model’s predictions.

    iOS

    View code
Group Activities
  • Customizing spatial Persona templates

    Arrange spatial Personas in a team-based guessing game.

    visionOS

    View code
Health and fitness
  • Customizing workouts with WorkoutKit

    Create, preview, and sync workouts for use in the Workout app on Apple Watch.

    iOS

    View code
  • Visualizing HealthKit State of Mind in visionOS

    Learn how to incorporate HealthKit State of Mind into your app and visualize the data in visionOS.

    iOS visionOS

    View code
Maps and location
  • Monitoring location changes with Core Location

    Define boundaries and act on user location updates.

    iOS

    View code
  • Adopting live updates in Core Location

    Simplify location delivery using asynchronous events in Swift.

    iOS

    View code
  • Interacting with nearby points of interest

    Provide automatic search completions for a partial search query, search the map for relevant locations nearby, and retrieve details for selected points of interest.

    iOS

    View code
Metal
  • Processing HDR Images with Metal

    Implement a post-processing pipeline using the latest features on Apple GPUs.

    iOS macOS tvOS

    View code
  • Rendering reflections in real time using ray tracing

    Implement realistic real-time lighting by dynamically generating reflection maps by encoding a ray-tracing compute pass.

    iOS macOS

    View code
PencilKit
  • Configuring the PencilKit tool picker

    Incorporate a custom PencilKit tool picker with a variety of system and custom tools into a drawing app.

    iOS visionOS

    View code
Photos and camera
  • Capturing consistent color images

    Add the power of a photography studio and lighting rig to your app with the new Constant Color API.

    iOS

    View code
  • Writing spatial photos

    Create spatial photos for visionOS by packaging a pair of left- and right-eye images as a stereo HEIC file with related spatial metadata.

    macOS

    View code
  • AVCam: Building a camera app

    Capture photos and record video using the front and rear iPhone and iPad cameras.

    iOS

    View code
RealityKit
  • Presenting an artist’s scene

    Display a scene from Reality Composer Pro in visionOS.

    visionOS

    View code
  • Creating a Spaceship game

    Build an immersive game using RealityKit audio, simulation, and rendering features.

    iOS visionOS

    View code
  • Creating a spatial drawing app with RealityKit

    Use low-level mesh and texture APIs to achieve fast updates to a person's brush strokes by integrating RealityKit with ARKit and SwiftUI.

    visionOS

    View code
  • Building an object reconstruction app

    Reconstruct objects from user-selected input images by using photogrammetry.

    macOS

    View code
  • Construct an immersive environment for visionOS

    Build efficient custom worlds for your app.

    visionOS

    View code
  • Transforming RealityKit entities using gestures

    Build a RealityKit component to support standard visionOS gestures on any entity.

    visionOS

    View code
  • Simulating particles in your visionOS app

    Add a range of visual effects to a RealityKit view by attaching a particle emitter component to an entity.

    visionOS

    View code
  • Simulating physics with collisions in your visionOS app

    Create entities that behave and react like physical objects in a RealityKit view.

    visionOS

    View code
  • Rendering a windowed game in stereo

    Bring an iOS or iPadOS game to visionOS and enhance it.

    visionOS

    View code
  • Composing interactive 3D content with RealityKit and Reality Composer Pro

    Build an interactive scene using an animation timeline.

    visionOS

    View code
  • Combining 2D and 3D views in an immersive app

    Use attachments to place 2D content relative to 3D content in an immersive space.

    visionOS

    View code
Swift
  • Updating an app to use strict concurrency

    Use this code to follow along with a guide to migrating your code to take advantage of the full concurrency protection that the Swift 6 language mode provides.

    iOS watchOS

    View code
Swift Charts
  • Creating a data visualization dashboard with Swift Charts

    Visualize an entire data collection efficiently by instantiating a single vectorized plot in Swift Charts.

    iOS macOS visionOS

    View code
SwiftData
  • Adopting SwiftData for a Core Data app

    Persist data in your app intuitively with the Swift native persistence framework.

    iOS macOS tvOS

    View code
SwiftUI
  • Creating a tvOS media catalog app in SwiftUI

    Build standard content lockups and rows of content shelves for your tvOS app.

    tvOS

    View code
  • Creating visual effects with SwiftUI

    Add scroll effects, rich color treatments, custom transitions, and advanced effects using shaders and a text renderer.

    iOS

    View code
  • Customizing window styles and state-restoration behavior in macOS

    Configure how your app’s windows look and function in macOS to provide an engaging and more coherent experience.

    macOS

    View code
  • Building a document-based app with SwiftUI

    Create, save, and open documents in a multiplatform app.

    iOS macOS

    View code
  • Enhancing your app’s content with tab navigation

    Keep your app content front and center while providing quick access to navigation using the tab bar.

    iOS macOS tvOS visionOS

    View code
TabletopKit
  • Creating tabletop games

    Develop a spatial board game where multiple players interact with pieces on a table.

    visionOS

    View code
Translation
  • Translating text within your app

    Display simple system translations and create custom translation experiences.

    iOS macOS

    View code
VisionOS
  • Diorama

    Design scenes for your visionOS app using Reality Composer Pro.

    Diorama

    View code
  • Hello World

    Use windows, volumes, and immersive spaces to teach people about the Earth.

    visionOS

    View code
  • Happy Beam

    Leverage a Full Space to create a fun game using ARKit.

    visionOS

    View code
  • Building an immersive media viewing experience

    Walk through the process of setting up assignments and recording student progress.

    visionOS

    View code
  • Swift Splash

    Use RealityKit to create an interactive ride in visionOS.

    visionOS

    View code
  • Interacting with virtual content blended with passthrough

    Present a mixed immersion style space to draw content in a person’s surroundings, and choose how upper limbs appear with respect to rendered content.

    visionOS

    View code
  • Enabling video reflections in an immersive environment

    Create a more immersive experience by adding video reflections in a custom environment.

    visionOS

    View code
Wallet
  • Implementing Wallet Extensions

    Support adding an issued card to Apple Pay from directly within Apple Wallet using Wallet Extensions.

    iOS

    View code