• Podcast: “What’s new in Swift 5.5”, with special guest Antoine van der Lee

    Antoine van der Lee, creator of SwiftLee, joins John to discuss the new language features that are being introduced as part of Swift 5.5 — from the brand new concurrency system, to convenience features and various improvements. Sponsors Stream: Build scalable in-app chat or activity feeds in record time using Stream’s open source, Swift-native SDK…

    Read More

  • Async sequences, streams, and Combine

    When iterating over any Swift collection using a standard for loop, there are two key components that decide what elements that will be passed into our iteration code — a sequence, and an iterator. For example, Swift’s standard Array type is a sequence, and uses IndexingIterator as its iterator type. While we very often interact…

    Read More

  • Stroking and filling a SwiftUI shape at the same time

    One really powerful aspect of SwiftUI’s overall API is that it enables us to draw things like shapes, gradients, and colors the same way that we render views and UI controls. For example, if we wanted to render a button shaped as a rounded rectangle, then we could do so by assigning a RoundedRectangle shape…

    Read More

  • Podcast: “Cross-platform SwiftUI”, with special guest Malin Sundberg

    Malin Sundberg joins John to talk about her experiences of using SwiftUI to build and ship the time-tracking and invoicing app Orbit on most of Apple’s platforms, and what sort of things that can be good to keep in mind when using SwiftUI in a cross-platform context. Sponsors Tower: Take advantage of Git’s powerful feature…

    Read More

  • Attaching property wrappers to function arguments

    New in Swift 5.5: Property wrappers can now be applied directly to function arguments, just like how they can be used to add additional functionality to a property or local variable. For example, let’s say that an app that we’re working on contains a function that saves a Photo for a given name, and that…

    Read More

  • Throwing and asynchronous Swift properties

    Swift 5.5 introduces a new concept called “effectful read-only properties”, which essentially means that computed properties can now utilize control flow mechanisms like errors and async operations when computing their values. Throwing properties Let’s start by taking a look at how computed properties can now throw errors using Swift’s standard error handling mechanism. As an…

    Read More

  • Podcast: “WWDC21, two months later”, with special guest Jordan Morgan

    Jordan Morgan returns to the show to discuss some of the key new APIs and frameworks that were announced at WWDC21, and how they can be integrated into the apps that we build, now that about two months have passed since the conference took place. Sponsors Bitrise: Rock-solid continuous integration for your Swift project, which…

    Read More

  • Using ‘@unknown default’ within switch statements

    When switching on an enum, we are required to either explicitly handle all of its cases, or provide a default case that’ll act as a fallback for cases that weren’t matched by any previous case statement. For example like this: struct Article { enum State { case draft case published case removed } var state:…

    Read More

  • Making SwiftUI views refreshable

    At WWDC21, Apple introduced a new SwiftUI API that enables us to attach refresh actions to any view, which in turn now gives us native support for the very popular pull-to-refresh mechanism. Let’s take a look at how this new API works, and how it also enables us to build completely custom refreshing logic as…

    Read More

  • Calling async functions within a Combine pipeline

    When starting to adopt Swift’s new async/await feature, we’re likely going to have to find ways to connect and bridge that pattern to any existing asynchronous code that we’ve already written within a given project. Earlier this week, we took a look at how that can be done when it comes to completion handler-based APIs,…

    Read More