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
 

Vídeos

Abrir menu Fechar menu
  • Coleções
  • Todos os vídeos
  • Sobre

Mais vídeos

  • Sobre
  • Código
  • What’s new in Swift

    Join us for an update on Swift. We'll briefly go through a history of Swift over the past decade, and show you how the community has grown through workgroups, expanded the package ecosystem, and increased platform support. We'll introduce you to a new language mode that achieves data-race safety by default, and a language subset that lets you run Swift on highly constrained systems. We'll also explore some language updates including noncopyable types, typed throws, and improved C++ interoperability.

    Capítulos

    • 0:00 - Introduction
    • 0:12 - Swift over the years
    • 3:44 - Agenda
    • 3:58 - Swift project update
    • 4:08 - Community
    • 4:59 - Packages
    • 5:50 - Blogs
    • 6:33 - Swift everywhere
    • 7:37 - Cross compilation to Linux
    • 11:27 - Foundation
    • 13:06 - Swift Testing
    • 14:34 - Improvements to builds
    • 16:15 - Swift's new space
    • 17:03 - Language updates
    • 17:29 - Noncopyable types
    • 19:55 - Embedded Swift
    • 21:47 - C++ interoperability
    • 23:34 - Typed throws
    • 26:07 - Swift 6 language mode and data-race safety
    • 28:43 - Low-level synchronization primitives
    • 29:59 - Wrap up

    Recursos

    • Swift Migration Guide
    • Swift Community Overview
    • Install Swift
    • Swift Blog
    • Forum: Programming Languages
    • Swift Forums
    • The Swift Programming Language
      • Vídeo HD
      • Vídeo SD

    Vídeos relacionados

    WWDC24

    • Consume noncopyable types in Swift
    • Demystify explicitly built modules
    • Explore Swift performance
    • Go further with Swift Testing
    • Go small with Embedded Swift
    • Meet Swift Testing
    • Migrate your app to Swift 6

    WWDC23

    • Meet Swift OpenAPI Generator
    • Mix Swift and C++
  • Buscar neste vídeo...
    • 9:15 - Swift Build

      swift build
    • 9:20 - Inspecting the build output

      file .build/debug/CatService
    • 9:24 - Run the REST API service

      .build/debug/CatService
    • 9:30 - Make a request to REST API service

      curl localhost:8080/api/emoji
    • 9:45 - Install the Fully static Linux SDK for Swift

      swift sdk install ~/preview-static-swift-linux-0.0.1.tar.gz
    • 10:18 - Swift build command flag to cross compile

      swift build --swift-sdk aarch64-swift-linux-musl
    • 10:30 - Inspecting the build output

      file .build/debug/CatService
    • 10:35 - Copy the service over to our Linux server and run it

      scp .build/debug/CatService demo-linux-host:~/CatService
      ./CatService
    • 10:45 - Make a request to REST API service from macOS to Linux

      curl demo-linux-host:8080/api/emoji
    • 13:50 - Swift Testing - Declare a test function

      // Swift Testing 
      
      import Testing
      
      @Test
      func rating() {
          let video = Video(id: 2, name: "Mystery Creek")
          #expect(video.rating == "⭐️⭐️⭐️⭐️")
      }
    • 13:55 - Swift Testing - Customize a test’s name

      // Swift Testing 
      
      import Testing
      
      @Test("Recognized rating")
      func rating() {
          let video = Video(id: 2, name: "Mystery Creek")
          #expect(video.rating == "⭐️⭐️⭐️⭐️")
      }
    • 14:13 - Swift Testing - Organize test function with tags

      // Swift Testing 
      
      import Testing
      
      @Test("Recognized rating",
             .tags(.critical))
      func rating() {
          let video = Video(id: 2, name: "Mystery Creek")
          #expect(video.rating == "⭐️⭐️⭐️⭐️")
      }
    • 14:19 - Swift Testing - Parameterize test with arguments

      // Swift Testing 
      
      import Testing
      
      @Test("Recognized rating",
             .tags(.critical),
             arguments: [
                 (1, "A Beach",       "⭐️⭐️⭐️⭐️⭐️"),
                 (2, "Mystery Creek", "⭐️⭐️⭐️⭐️"),
             ])
      func rating(videoId: Int, videoName: String, expectedRating: String) {
          let video = Video(id: videoId, name: videoName)
          #expect(video.rating == expectedRating)
      }
    • 17:50 - Noncopyable types

      struct File: ~Copyable {
        private let fd: CInt
        
        init(descriptor: CInt) {
          self.fd = descriptor
        }
      
        func write(buffer: [UInt8]) {
          // ...
        }
      
        deinit {
          close(fd)
        }
      }
    • 18:12 - Noncopyable types

      guard let fd = open(name) else {
        return
      }
      let file = File(descriptor: fd)
      file.write(buffer: data)
    • 18:42 - Noncopyable types

      struct File: ~Copyable {
        private let fd: CInt
        
        init?(name: String) {
          guard let fd = open(name) else {
            return nil
          }
          self.fd = fd
        }
      
        func write(buffer: [UInt8]) {
          // ...
        }
      
        deinit {
          close(fd)
        }
      }
    • 22:29 - C++ Interoperability

      struct Person {
        Person(const Person&) = delete;
        Person(Person &&) = default;
        // ...
      };
    • 22:34 - C++ Interoperability

      struct Developer: ~Copyable {
          let person: Person
          init(person: consuming Person) {
            self.person = person
          }
      }
      
      let person = Person()
      let developer = Developer(person: person)
    • 22:40 - C++ Interoperability

      struct Developer: ~Copyable {
          let person: Person
          init(person: consuming Person) {
            self.person = person
          }
      }
      
      let person = Person()
      let developer = Developer(person: person)
      person.printInfo()
    • 23:43 - Untyped throws

      enum IntegerParseError: Error {
        case nonDigitCharacter(String, index: String.Index)
      }
      
      func parse(string: String) throws -> Int {
        for index in string.indices {
          // ...
          throw IntegerParseError.nonDigitCharacter(string, index: index)
        }
      }
      
      do {
        let value = try parse(string: "1+234")
      }
      catch let error as IntegerParseError {
        // ...
      }
      catch {
         // error is 'any Error'
      }
    • 24:19 - Typed throws

      enum IntegerParseError: Error {
        case nonDigitCharacter(String, index: String.Index)
      }
      
      func parse(string: String) throws(IntegerParseError) -> Int {
        for index in string.indices {
          // ...
          throw IntegerParseError.nonDigitCharacter(string, index: index)
        }
      }
      
      do {
        let value = try parse(string: "1+234")
      }
      catch {
         // error is 'IntegerParseError'
      }
    • 24:39 - Typed throws - any and Never error types

      func parse(string: String) throws -> Int {
        //...
      }
      
      func parse(string: String) throws(any Error) -> Int {
        //...
      }
      
      
      
      func parse(string: String) -> Int {
        //...
      }
      
      func parse(string: String) throws(Never) -> Int {
        //...
      }
    • 28:02 - Passing a NonSendable reference across actor isolation boundaries

      class Client {
        init(name: String, balance: Double) {}
      }
      
      actor ClientStore {
        static let shared = ClientStore()
        private var clients: [Client] = []
        func addClient(_ client: Client) {
          clients.append(client)
        }
      }
      
      @MainActor
      func openAccount(name: String, balance: Double) async {
        let client = Client(name: name, balance: balance)
        await ClientStore.shared.addClient(client)
      }
    • 28:52 - Atomic

      import Dispatch
      import Synchronization 
      
      let counter = Atomic<Int>(0)
      
      DispatchQueue.concurrentPerform(iterations: 10) { _ in
        for _ in 0 ..< 1_000_000 {
          counter.wrappingAdd(1, ordering: .relaxed)
        }
      }
      
      print(counter.load(ordering: .relaxed))
    • 29:21 - Mutex

      import Synchronization
      
      final class LockingResourceManager: Sendable {
        let cache = Mutex<[String: Resource]>([:])
        
        func save(_ resource: Resource, as key: String) {
          cache.withLock {
            $0[key] = resource
          }
        }
      }

Developer Footer

  • Vídeos
  • WWDC24
  • What’s new in Swift
  • 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