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
 

Vidéos

Ouvrir le menu Fermer le menu
  • Collections
  • Toutes les vidéos
  • À propos

Plus de vidéos

  • À propos
  • Code
  • Meet SwiftUI for spatial computing

    Take a tour of the solar system with us and explore SwiftUI for visionOS! Discover how you can build an entirely new universe of apps with windows, volumes, and spaces. We'll show you how to get started with SwiftUI on this platform as we build an astronomy app, add 3D content, and create a fully immersive experience to transport people to the stars.

    Chapitres

    • 0:00 - Introduction
    • 5:29 - Windows
    • 14:06 - Volumes
    • 20:35 - Full Spaces

    Ressources

    • Hello World
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC23

    • Build spatial experiences with RealityKit
    • Create accessible spatial experiences
    • Design for spatial user interfaces
    • Elevate your windowed app for spatial computing
    • Get started with building apps for spatial computing
    • Go beyond the window with SwiftUI
    • Meet ARKit for spatial computing
    • Meet UIKit for spatial computing
    • Principles of spatial design
    • Run your iPad and iPhone apps in the Shared Space
    • What’s new in SwiftUI
  • Rechercher dans cette vidéo…
    • 2:02 - Button

      Button("Of course") {
        // perform action
      }
    • 2:41 - Toggle Favorite

      Toggle(isOn: $favorite) {
          Label("Favorite", systemImage: "star")
      }
    • 2:48 - TabView

      TabView {
          DogsTab()
              .tabItem {
                  Label("Dogs", systemImage: "pawprint")
              }
      
          CatsTab()
              .tabItem {
                  Label("Cats", image: "cat")
              }
      
          BirdsTab()
              .tabItem {
                  Label("Birds", systemImage: "bird")
              }
      }
    • 3:37 - World App

      @main
      struct WorldApp: App {
          var body: some Scene {
              WindowGroup("Hello, world") {
                  ContentView()
              }
          }
      }
    • 7:03 - World TabView

      @main
      struct WorldApp: App {
          var body: some Scene {
              WindowGroup("Hello, world") {
                  TabView {
                      Modules()
                          .tag(Tabs.menu)
                          .tabItem {
                              Label("Experience", systemImage: "globe.americas")
                          }
                      FunFactsTab()
                    	    .tag(Tabs.library)
                          .tabItem {
                              Label("Library", systemImage: "book")
                          }                    
                  }
              }
          }
      }
    • 8:42 - Stats Grid Section

      VStack(alignment: .leading, spacing: 12) {
          Text("Stats")
              .font(.title)
      
          StatsGrid(stats: stats)
              .padding()
              .background(.regularMaterial, in: .rect(cornerRadius: 12))
      }
    • 9:23 - Fun Fact Button

      Button(action: {
          // perform button action
      }) {
          VStack(alignment: .leading, spacing: 12) {
              Text(fact.title)
                  .font(.title2)
                  .lineLimit(2)
              Text(fact.details)
                  .font(.body)
                  .lineLimit(4)
              Text("Learn more")
                  .font(.caption)
                  .foregroundStyle(.secondary)
          }
          .frame(width: 180, alignment: .leading)
      }
      .buttonStyle(.funFact)
    • 13:15 - FunFactButtonStyle

      struct FunFactButtonStyle: ButtonStyle {
          func makeBody(configuration: Configuration) -> some View {
              configuration.label
                  .padding()
                  .background(.regularMaterial, in: .rect(cornerRadius: 12))
                  .hoverEffect()
                  .scaleEffect(configuration.isPressed ? 0.95 : 1)
          }
      }
    • 14:17 - Globe Volume

      @main
      struct WorldApp: App {
          var body: some Scene {
              WindowGroup {
                  Globe()
              }
              .windowStyle(.volumetric)
              .defaultSize(width: 600, height: 600, depth: 600)
          }
      }
    • 14:36 - Model3D

      import SwiftUI
      import RealityKit
      
      struct Globe: View {
          var body: some View {
              Model3D(named: "Earth")
          }
      }
    • 15:40 - Globe with rotation and controls

      struct Globe: View {
          @State var rotation = Angle.zero
          var body: some View {
              ZStack(alignment: .bottom) {
                  Model3D(named: "Earth")
                      .rotation3DEffect(rotation, axis: .y)
                      .onTapGesture {
                          withAnimation(.bouncy) {
                              rotation.degrees += randomRotation()
                          }
                      }
                      .padding3D(.front, 200)
                  
                  GlobeControls()
                      .glassBackgroundEffect(in: .capsule)
              }
          }
      
          func randomRotation() -> Double {
              Double.random(in: 360...720)
          }
      }
    • 17:30 - RealityView

      RealityView { content in
          if let earth = try? await
              ModelEntity(named: "Earth")
          {
             earth.addImageBasedLighting()
             content.add(earth)
          }
      }
    • 18:57 - RealityView Gesture

      struct Earth: View {
      		@State private var pinLocation: GlobeLocation?
      
          var body: some View {
              RealityView { content in
                  if let earth = try? await
                      ModelEntity(named: "Earth")
                  {
                     earth.addImageBasedLighting()
                     content.add(earth)
                  }
              }
      				.gesture(
                  SpatialTapGesture()
                      .targetedToAnyEntity()
                      .onEnded { value in
                          withAnimation(.bouncy) {
                              rotation.degrees += randomRotation()
                              animatingRotation = true
                          } completion: {
                              animatingRotation = false
                          }
                          pinLocation = lookUpLocation(at: value)
                      }
              )
          }
      }
    • 19:34 - RealityView Attachments

      struct Earth: View {
      		@State private var pinLocation: GlobeLocation?
      
          var body: some View {
              RealityView { content in
                  if let earth = try? await
                      ModelEntity(named: "Earth")
                  {
                     earth.addImageBasedLighting()
                     content.add(earth)
                  }
              } update: { content, attachments in
                  if let pin = attachments.entity(for: "pin") {
                      content.add(pin)
                      placePin(pin)
                  }
              } attachments: {
                  if let pinLocation {
                      GlobePin(pinLocation: pinLocation)
                          .tag("pin")
                  }
              }
      				.gesture(
                  SpatialTapGesture()
                      .targetedToAnyEntity()
                      .onEnded { value in
                          withAnimation(.bouncy) {
                              rotation.degrees += randomRotation()
                              animatingRotation = true
                          } completion: {
                              animatingRotation = false
                          }
                          pinLocation = lookUpLocation(at: value)
                      }
              )
          }
      }
    • 21:11 - ImmersiveSpace

      @main
      struct WorldApp: App {
          var body: some Scene {
      				// (other WindowGroup scenes)
      
              ImmersiveSpace(id: "solar-system") {
                  SolarSystem()
              }
          }
      }
    • 21:25 - Open ImmersiveSpace Action

      @Environment(\.openImmersiveSpace)
      private var openImmersiveSpace
      
      Button("View Outer Space") {
          openImmersiveSpace(id: "solar-system")
      }
    • 22:50 - ImmersionStyle

      @main
      struct WorldApp: App {
          @State private var selectedStyle: ImmersionStyle = .full
          var body: some Scene {
      				// (other WindowGroup scenes)
      
              ImmersiveSpace(id: "solar-system") {
                  SolarSystem()
              }
              .immersionStyle(selection: $selectedStyle, in: .full)
          }
      }
    • 23:17 - Starfield

      struct Starfield: View {
          var body: some View {
              RealityView { content in
                  let starfield = await loadStarfield()
                  content.add(starfield)
              }
          }
      }
    • 23:28 - SolarSystem

      struct SolarSystem: View {
          var body: some View {
              Earth()
              Sun()
            	Starfield()
          }
      }

Developer Footer

  • Vidéos
  • WWDC23
  • Meet SwiftUI for spatial computing
  • 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