• Making async system APIs backward compatible

    Although Swift 5.5’s new concurrency system is becoming backward compatible in Xcode 13.2, some of the built-in system APIs that make use of these new concurrency features are still only available on iOS 15, macOS Monterey, and the rest of Apple’s 2021 operating systems. For example, if we try to use the new async/await-favored version…

    Read More

  • Building editable lists with SwiftUI

    To say that SwiftUI’s List is the equivalent of UIKit’s UITableView is both true and false at the same time. It’s definitely true that List offers a built-in way to construct list-based UIs that are rendered using the same overall appearance as when using UITableView — however, when it comes to mutations, we instead have…

    Read More

  • Specialized extensions using generic type constraints

    Combining Swift’s powerful generics system with the fact that any Swift type can be extended with new APIs and capabilities enables us to write targeted extensions that conditionally add new features to a type or protocol when it fits certain requirements. It all starts with the where keyword, which lets us apply generic type constraints…

    Read More

  • New Discover page: Generics

    Learn how to fully utilize Swift’s powerful generics system to write reusable types, functions, extensions, and protocols. → Check it out

    Read More

  • Swift’s new concurrency system gains backward compatibility in Xcode 13.2

    Starting in Xcode 13.2, Swift’s new suite of concurrency features are now backward compatible all the way back to iOS 13, macOS Catalina, watchOS 6, and tvOS 13. The new concurrency features include async/await, actors, structured concurrency, async sequences, and more. While Xcode 13.2 is, at the time of writing, currently in beta — this…

    Read More

  • Sponsor: Paste

    My thanks to the team behind the clipboard management app Paste for sponsoring Swift by Sundell last week, and for helping me continue to keep the site completely free to access for everyone. Paste is like a time machine for your clipboard. It stores every link, image, file, and piece of code that you copy…

    Read More

  • Codable synthesis for Swift enums

    One of the major advantages of Swift’s built-in Codable API is how the compiler is able to automatically synthesize many different encoding and decoding implementations when using it. In many cases, all that we have to do to enable a Swift type to be serialized into formats like JSON is to mark it as Codable,…

    Read More

  • New Discover page: Codable

    Discover Swift’s Codable protocol, how to fully leverage its compiler synthesis features, and how to use its surrounding APIs to write efficient serialization code. → Check it out

    Read More