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
  • Explore ARKit 5

    Build the next generation of augmented reality apps with ARKit 5. Explore how you can use Location Anchors in additional regions and more easily onboard people into your location-based AR experience. Learn more about Face Tracking and Motion Capture. And discover best practices for placing your AR content in the real world. We'll also show you how you can integrate App Clip Codes into your AR app for easy discovery and precise positioning of your virtual content.

    Ressources

    • Human Interface Guidelines: App Clip Codes
    • Interacting with App Clip Codes in AR
    • Explore the ARKit Developer Forums
    • Tracking geographic locations in AR
    • ARKit
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC22

    • Discover ARKit 6

    WWDC21

    • Build light and fast App Clips
    • Dive into RealityKit 2
    • What's new in App Clips

    WWDC20

    • Explore ARKit 4

    WWDC19

    • Bringing People into AR
  • Rechercher dans cette vidéo…
    • 3:29 - Geo Tracking Recap I

      // Check device support for geo-tracking
      guard ARGeoTrackingConfiguration.isSupported else {
          // Geo-tracking not supported on this device
          return
      }
      
      // Check current location is supported for geo-tracking
      ARGeoTrackingConfiguration.checkAvailability { (available, error) in
          guard available else {
              // Geo-tracking is not available at this location
              return
          }
      
          // Run ARSession
          let arView = ARView()
          arView.session.run(ARGeoTrackingConfiguration())
      }
    • 3:42 - Geo Tracking Recap II

      // Create Location Anchor and add to session
      let coordinate = CLLocationCoordinate2D(latitude: 37.795313, longitude: -122.393792)
      let geoAnchor = ARGeoAnchor(name: “Ferry Building”, coordinate: coordinate)
      arView.session.add(anchor: geoAnchor)
      
      // Monitor geo-tracking status updates
      func session(_ session: ARSession, didChange geoTrackingStatus: ARGeoTrackingStatus) {
          …
      }
    • 6:02 - Geo Tracking Coaching Overlay

      // Declare coaching view
      let coachingOverlay = ARCoachingOverlayView()
      
      // Set up coaching view (assuming ARView already exists)
      coachingOverlay.session = self.arView.session
      coachingOverlay.delegate = self
      coachingOverlay.goal = .geoTracking
           
      coachingOverlay.translatesAutoresizingMaskIntoConstraints = false
      self.arView.addSubview(coachingOverlay)
      
      NSLayoutConstraint.activate([
          coachingOverlay.centerXAnchor.constraint(equalTo: view.centerXAnchor),
          coachingOverlay.centerYAnchor.constraint(equalTo: view.centerYAnchor),
          coachingOverlay.widthAnchor.constraint(equalTo: view.widthAnchor),
          coachingOverlay.heightAnchor.constraint(equalTo: view.heightAnchor),
      ])
    • 8:53 - GeoTracking Distance Method

      // Method to compute distance (in meters) between points
      func distance(from location: CLLocation) -> CLLocationDistance
    • 12:16 - App Clip Code: check device support

      func viewDidLoad() {
          // Check device support for app clip code tracking
          guard ARWorldTrackingConfiguration.supportsAppClipCodeTracking else { return }
          
          let worldConfig = ARWorldTrackingConfiguration()
          worldConfig.appClipCodeTrackingEnabled = true
          arSession.run(worldConfig)
      }
    • 12:34 - Accessing the URL of an App Clip Code

      /// Accessing the URL of an App Clip Code 
      override func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) {
          for anchor in anchors {
              guard let appClipCodeAnchor = anchor as? ARAppClipCodeAnchor, appClipCodeAnchor.isTracked else { return }
              
              switch appClipCodeAnchor.urlDecodingState {
              case .decoding:
                  displayPlaceholderVisualizationOnTopOf(anchor: appClipCodeAnchor)
              case .failed:
                  displayNoURLErrorMessageOnTopOf(anchor: appClipCodeAnchor)
              case .decoded:
                  let url = appClipCodeAnchor.url!
                  let anchorEntity = AnchorEntity(anchor: appClipCodeAnchor)
                  arView.scene.addAnchor(anchorEntity)
                  let visualization = AppClipCodeVisualization(url: url, radius: appClipCodeAnchor.radius)
                  anchorEntity.addChild(visualization)
                }
          }
      }
    • 15:34 - Adding a gesture recognizer

      /// Adding a gesture recognizer for user interaction
      func viewDidLoad() {
          initializeARView()
          initializeCoachingOverlays()
              
          // Place sunflower on the ground when the user taps the screen
          let tapGestureRecognizer = UITapGestureRecognizer(
           target: self,
           action: #selector(handleTap(recognizer:)))
          arView.addGestureRecognizer(tapGestureRecognizer)
      }
    • 15:45 - Tap to place the sunflower

      func handleTap(recognizer: UITapGestureRecognizer) {
          let location = recognizer.location(in: arView)
          // Attempt to find a 3D location on a horizontal
          // surface underneath the user's touch location.
          let results = arView.raycast(
            from: location, 
            allowing: .estimatedPlane,
            alignment: .horizontal)
          guard let firstResult = results.first else { return }
          // Fetch the last decoded app clip code URL
          guard let appClipCodeURL = decodedURLs.last else { return }
          // Add an ARAnchor & AnchorEntity at the touch location
          let anchor = ARAnchor(transform: firstResult.worldTransform)
          arView.session.add(anchor: anchor)
          let anchorEntity = AnchorEntity(anchor: anchor)
          arView.scene.addAnchor(anchorEntity)    
          // Download the 3D model associated with this app clip code.
          downloadAndDisplay(appClipCodeURL, on: anchorEntity)
      }
    • 18:33 - Checking for supported video formats for face tracking

      // Check if the ultra wide video format is available.
      // If so, set it on a face tracking configuration & run the session with that.
      
      let config = ARFaceTrackingConfiguration()
      for videoFormat in ARFaceTrackingConfiguration.supportedVideoFormats {
          if videoFormat.captureDeviceType == .builtInUltraWideCamera {
              config.videoFormat = videoFormat
              break
          }
      }
      session.run(config)

Developer Footer

  • Vidéos
  • WWDC21
  • Explore ARKit 5
  • 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