View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Videos

Abrir menú Cerrar menú
  • Colecciones
  • Todos los videos
  • Información

Más videos

  • Información
  • Código
  • Build spatial SharePlay experiences

    Discover how you can use the GroupActivities framework to build unique sharing and collaboration experiences for visionOS. We'll introduce you to SharePlay on this platform, learn how to create experiences that make people feel present as if they were in the same space, and explore how immersive apps can respect shared context between participants.

    Recursos

    • SystemCoordinator
      • Video HD
      • Video SD

    Videos relacionados

    WWDC23

    • Add SharePlay to your app
    • Design spatial SharePlay experiences
    • Go beyond the window with SwiftUI

    WWDC21

    • Build custom experiences with Group Activities

    WWDC19

    • Targeting Content with Multiple Windows
  • Buscar este video…
    • 4:08 - Observe the local participant state

      for await session in ExploreActivity.sessions() {
          guard let systemCoordinator = await session.systemCoordinator else { continue }
      
          let isLocalParticipantSpatial = systemCoordinator.localParticipantState.isSpatial
      
          Task.detached {
              for await localParticipantState in systemCoordinator.localParticipantStates {
                  if localParticipantState.isSpatial {
                      // Start syncing scroll position
                  } else {
                      // Stop syncing scroll position
                  }
              }
          }
      }
    • 6:10 - Configure the spatial template preferences

      for await session in ExploreActivity.sessions() {
          guard let systemCoordinator = await session.systemCoordinator else { continue }
      
          var configuration = SystemCoordinator.Configuration()
          configuration.spatialTemplatePreference = .sideBySide
          systemCoordinator.configuration = configuration
      
          session.join()
      }
    • 9:10 - Configuring scene activation conditions

      @main
      struct ExploreTogetherApp: App {
          var body: some Scene {
              WindowGroup {
                  ContentView()
                      .handlesExternalEvents(
                          preferring: ["com.example.explore-together.activity"],
                          allowing: ["com.example.explore-together.activity"]
                      )
              }
          }
      }
    • 9:30 - Configuring scene activation conditions

      class SceneDelegate: NSObject, UISceneDelegate {
      
          func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
              // ...
      
              scene.activationConditions.canActivateForTargetContentIdentifierPredicate =
                      NSPredicate(format: "self == %@", "com.example.explore-together.activity")
      
              scene.activationConditions.prefersToActivateForTargetContentIdentifierPredicate =
                      NSPredicate(format: "self == %@", "com.example.explore-together.activity")
          }
      }
    • 10:40 - Setting scene association behavior

      struct ExploreActivity: GroupActivity {
          var metadata: GroupActivityMetadata {
              var metadata = GroupActivityMetadata()
              // ...
              metadata.sceneAssociationBehavior = .content("document-1")
              return metadata
          }
      }
    • 13:44 - Starting SharePlay

      // Create the activity
      let activity = ExploreActivity()
      
      // Register the activity on the item provider
      let itemProvider = NSItemProvider()
      itemProvider.registerGroupActivity(activity)
      
      // Create the activity items configuration
      let configuration = UIActivityItemsConfiguration(itemProviders: [itemProvider])
      
      // Provide the metadata for the group activity
      configuration.metadataProvider = { key in
          guard key == .linkPresentationMetadata else { return nil }
          let metadata = LPLinkMetadata()
          metadata.title = "Explore Together"
          metadata.imageProvider = NSItemProvider(object: UIImage(named: "explore-activity")!)
          return metadata
      }
      self.activityItemsConfiguration = configuration
    • 16:03 - Configure group ImmersiveSpace

      for await session in ExploreActivity.sessions() {
          guard let systemCoordinator = await session.systemCoordinator else { continue }
      
          var configuration = SystemCoordinator.Configuration()
          configuration.supportsGroupImmersiveSpace = true
          systemCoordinator.configuration = configuration
      }
    • 17:51 - System Experience Displacement

      // Use immersiveSpaceDisplacement to offset contents in group immersive space
      
      var body: some Scene {
          ImmersiveSpace(id: "earth") {
              GeometryReader3D { proxy in
                  let displacement = proxy.immersiveSpaceDisplacement(in: .global).inverse
      
                  Control()
                      .offset(displacement.position)
                      .rotation3DEffect(displacement.rotation)
              }
          }
      }
    • 20:46 - Spatial Template Preferences

      // Configure the spatial template preferences with content extent
      
      for await session in ExploreSolarActivity.sessions() {
          guard let systemCoordinator = await session.systemCoordinator else { continue }
      
          var configuration = SystemCoordinator.Configuration()
          configuration.supportsGroupImmersiveSpace = true
          configuration.spatialTemplatePreference = .sideBySide.contentExtent(200)
          systemCoordinator.configuration = configuration
      }
    • 22:32 - Receive group immersion style to configure group immersive space

      // Receive group immersion style to configure group immersive space
      
      for await session in ExploreSolarActivity.sessions() {
          guard let systemCoordinator = await session.systemCoordinator else { continue }
      
          Task.detached {
              for await immersionStyle in systemCoordinator.groupImmersionStyle {
                  if let immersionStyle {
                      // Open an immersive space with the same immersion style
                  } else {
                      // Dismiss the immersive space
                  }
              }
          }
      }

Developer Footer

  • Videos
  • WWDC23
  • Build spatial SharePlay experiences
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines