Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2025 App ServicesSpatial ComputingBusiness & Education

WWDC25 · 26 min · App Services / Spatial Computing / Business & Education

Explore enhancements to your spatial business app

Discover how the latest enhancements and APIs in visionOS 26 expand access and extend enterprise capabilities announced last year. Learn how these all-new features make it easy to build model training workflows, enhance video feeds, and enable you to align coordinate systems over a local network to develop collaborative experiences in your in-house app.

Watch at developer.apple.com ↗

Transcript all transcripts

Chapters

Code shown on screen · 6 snippets

createml on the Mac command line bash · at 3:00 ↗
xcrun createml objecttracker -s my.usdz -o my.referenceobject
VisionEntitlementServices swift · at 4:28 ↗
import VisionEntitlementServices

func checkLicenseStatus() {
    // Get the shared license details instance
    let license = EnterpriseLicenseDetails.shared

    // First, you might check the overall license status
    guard license.licenseStatus == .valid else {
        print("Enterprise license is not valid: \(license.licenseStatus)")
        // Optionally disable enterprise features or alert the user
        return
    }

    // Then, check for a specific entitlement before using the feature
    if license.isApproved(for: .mainCameraAccess) {
        // Safe to proceed with using the main camera API
        print("Main Camera Access approved. Enabling feature...")
        // ... enable camera functionality ...
    } else {
        // Feature not approved for this license
        print("Main Camera Access not approved.")
        // ... keep feature disabled, potentially inform user ...
    }
}
SharedCoordinateSpaceModel swift · at 10:04 ↗
//
//  SharedCoordinateSpaceModel.swift
//

import ARKit

class SharedCoordinateSpaceModel {
    let arkitSession = ARKitSession()
    let sharedCoordinateSpace = SharedCoordinateSpaceProvider()
    let worldTracking = WorldTrackingProvider()

    func runARKitSession() async {
        do {
            try await arkitSession.run([sharedCoordinateSpace, worldTracking])
        } catch {
            reportError("Error: running session: \(error)")
        }
    }

    // Push data received from other participants
    func pushCoordinateSpaceData(_ data: Data) {
        if let coordinateSpaceData = SharedCoordinateSpaceProvider.CoordinateSpaceData(data: data) {
            sharedCoordinateSpace.push(data: coordinateSpaceData)
        }
    }

    // Poll data to be sent to other participants
    func pollCoordinateSpaceData() async {
        if let coordinateSpaceData = sharedCoordinateSpace.nextCoordinateSpaceData {
            // Send my coordinate space data
        }
    }

    // Be notified when participants connect or disconnect from the shared coordinate space
    func processEventUpdates() async {
        let participants = [UUID]()
        for await event in sharedCoordinateSpace.eventUpdates {
            switch event {
                // Participants changed
            case .connectedParticipantIdentifiers(participants: participants):
                // handle change
                print("Handle change in participants")
            case .sharingEnabled:
                print("sharing enabled")
            case .sharingDisabled:
                print("sharing disabled")
            @unknown default:
                print("handle future events")
            }
        }
    }

    // Be notified when able to add shared world anchors
    func processSharingAvailabilityUpdates() async {
        for await sharingAvailability in worldTracking.worldAnchorSharingAvailability
            where sharingAvailability == .available {
            // Able to add anchor
        }
    }
    // Add shared world anchor
    func addWorldAnchor(at transform: simd_float4x4) async throws {
        let anchor = WorldAnchor(originFromAnchorTransform: transform, sharedWithNearbyParticipants: true)
        try await worldTracking.addAnchor(anchor)
    }

    // Process shared anchor updates from local session and from other participants
    func processWorldTrackingUpdates() async {
        for await update in worldTracking.anchorUpdates {
            switch update.event {
            case .added, .updated, .removed:
                // Handle anchor updates
                print("Handle updates to shared world anchors")
            }
        }
    }
}
contentCaptureProtected swift · at 12:50 ↗
// Example implementing contentCaptureProtected

struct SecretDocumentView: View {
    var body: some View {
        VStack {
            Text("Secrets")
                .font(.largeTitle)
                .padding()

            SensitiveDataView()
                .contentCaptureProtected()
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
    }
}
CameraRegionView swift · at 16:48 ↗
//
//  InspectorView.swift
//

import SwiftUI
import VisionKit

struct InspectorView: View {
    @Environment(CameraFeedDelivery.self) private var cameraFeedDelivery: CameraFeedDelivery

    var body: some View {
        CameraRegionView(isContrastAndVibrancyEnhancementEnabled: true) { result in
            var pixelBuffer: CVReadOnlyPixelBuffer?
            switch result {
            case .success(let value):
                pixelBuffer = value.pixelBuffer
            case .failure(let error):
                reportError("Failure: \(error.localizedDescription)")
                cameraFeedDelivery.stopFeed()
                return nil
            }

            cameraFeedDelivery.frameUpdate(pixelBuffer: pixelBuffer!)
            return nil
        }
    }
}

@main
struct EnterpriseAssistApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }

        WindowGroup(id: "InspectorView") {
            InspectorView()
        }
        .windowResizability(.contentSize)
    }
}
CameraRegionAnchor swift · at 21:15 ↗
class CameraRegionHandler {
    let arkitSession = ARKitSession()
    var cameraRegionProvider: CameraRegionProvider?
    var cameraRegionAnchor: CameraRegionAnchor?

    func setUpNewAnchor(anchor: simd_float4x4, width: Float, height: Float) async {
        let anchor = CameraRegionAnchor(originFromAnchorTransform: anchor,
                                        width: width,
                                        height: height,
                                        cameraEnhancement: .stabilization)

        guard let cameraRegionProvider = self.cameraRegionProvider else {
            reportError("Missing CameraRegionProvider")
            return
        }

        do {
            try await cameraRegionProvider.addAnchor(anchor)
        } catch {
            reportError("Error adding anchor: \(error)")
        }
        cameraRegionAnchor = anchor

        Task {
            let updates = cameraRegionProvider.anchorUpdates(forID: anchor.id)
            for await update in updates {
                let pixelBuffer = update.anchor.pixelBuffer
                // handle pixelBuffer
            }
        }
    }

    func removeAnchor() async {
        guard let cameraRegionProvider = self.cameraRegionProvider else {
            reportError("Missing CameraRegionProvider")
            return
        }

        if let cameraRegionAnchor = self.cameraRegionAnchor {
            do {
                try await cameraRegionProvider.removeAnchor(cameraRegionAnchor)
            } catch {
                reportError("Error removing anchor: \(error.localizedDescription)")
                return
            }
            self.cameraRegionAnchor = nil
        }
    }
}

Resources