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
  • Prototype with Xcode Playgrounds

    Speed up feature development by prototyping new code with Xcode Playgrounds, eliminating the need to keep rebuilding and relaunching your project to verify your changes. We'll show you how using a playground in your project or package can help you try out your code in various scenarios and take a close look at the returned values, including complex structures and user interface elements, so you can quickly iterate on a feature before integrating it into your project.

    Chapitres

    • 3:00 - Exploring the data model and inspecting UI snapshots
    • 14:26 - Becoming familiar with a new package
    • 18:07 - Using the Live View
    • 22:03 - Running the updated project

    Ressources

      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC20

    • Explore Packages and Projects with Xcode Playgrounds
  • Rechercher dans cette vidéo…
    • 2:04 - birdsToShow computed property before the required changes

      var birdsToShow: [Bird] {
          // TODO: Narrow down the list of birds to find.
          let birdProvider = BirdProvider(region: .northAmerica)
          return birdProvider.birds
      }
    • 4:15 - birdProvider instance

      let birdProvider = BirdProvider(region: .northAmerica)
    • 6:31 - CustomStringConvertible

      extension Bird: CustomStringConvertible {
          
          public var description: String {
              return "\(commonName) (\(scientificName))"
          }
          
      }
    • 8:17 - CustomPlaygroundDisplayConvertible

      extension Bird: CustomPlaygroundDisplayConvertible {
          
          public var playgroundDescription: Any {
              return photo as Any
          }
          
      }
    • 9:45 - Birds without a photo

      let birdsToFind = birdProvider.birds.filter { $0.photo == nil }
    • 10:52 - Owls without a photo

      let owlsToFind = birdsToFind.filter { $0.family == .owls }
    • 11:15 - Verifying the ChecklistView

      let checklist = ChecklistView()
      for bird in owlsToFind {
          checklist.add(bird)
      }
    • 13:41 - birdsToShow computed property with the required changes

      var birdsToShow: [Bird] {
          let birdProvider = BirdProvider(region: .northAmerica)
          let birdsToFind = birdProvider.birds.filter { $0.photo == nil }
          let owlsToFind = birdsToFind.filter { $0.family == .owls }
          return owlsToFind
      }
    • 14:21 - sightingToShow function before the required changes

      func sightingToShow(for bird: Bird) -> Sighting? {
          // TODO: Use BirdSightings package to fetch the most recent sighting.
          return nil
      }
    • 15:04 - BirdSightings package example

      let barnOwlCode = "BNOW"
      let centralParkLocation = CLLocationCoordinate2D(latitude:  40.785091, longitude: -73.968285)
      
      let sightingsProvider = SightingsProvider()
      sightingsProvider.fetchSightings(of: barnOwlCode, around: centralParkLocation)
    • 16:08 - Parameters for sightings fetching

      let bird = owlsToFind.first!
      let appleParkLocation = CLLocationCoordinate2D(latitude: 37.3348655, longitude: 122.0089409)
    • 17:31 - Sightings fetching

      let sightingsProvider = SightingsProvider()
      let sightings = sightingsProvider.fetchSightings(of: bird.speciesCode, around: appleParkLocation)
    • 18:23 - Initializing the SightingMapView

      let mostRecentSighting = sightings.first
      let sightingMapView = SightingMapView(sighting: mostRecentSighting)
    • 18:55 - Setting up the playground's live view

      import PlaygroundSupport
      PlaygroundPage.current.liveView = sightingMapView
    • 22:20 - sightingToShow function with the required changes

      func sightingToShow(for bird: Bird) -> Sighting? {
          let sightingsProvider = SightingsProvider()
          let sightings = sightingsProvider.fetchSightings(of: bird.speciesCode, around: lastCurrentLocation)
          let mostRecentSighting = sightings.first
          return mostRecentSighting
      }

Developer Footer

  • Vidéos
  • WWDC23
  • Prototype with Xcode Playgrounds
  • 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