• 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

  • Using Combine’s share operator to avoid duplicate work

    When writing asynchronous code using Combine, we might sometimes want to share the result of a given set of concurrent operations, rather than performing duplicate work for each one. Let’s take a look at how the share operator can enable us to do that in a really neat way. Duplicate, concurrent network calls As an…

    Read More

  • Previewing SwiftUI views in landscape

    Starting in Xcode 13, SwiftUI views can now be previewed in landscape orientation using the new previewInterfaceOrientation modifier. For example, here we’re previewing a MenuView in both portrait and landscape by creating two instances of our view within its PreviewProvider: struct MenuView_Previews: PreviewProvider { static var previews: some View { MenuView() MenuView().previewInterfaceOrientation(.landscapeRight) } } Note…

    Read More

  • Podcast: “Building various kinds of editors”, with special guest Marcin Krzyzanowski

    Marcin Krzyzanowski returns to the show to talk about building editors for Swift code, backend-driven user interfaces, and more. Also, the challenges of working with text-based data, the pros and cons of composition, and managing hobby projects. Sponsors RevenueCat: In-app subscriptions made easy. RevenueCat handles the pain points of implementing subscriptions and in-app purchases, so…

    Read More

  • Programmatic navigation in SwiftUI

    By default, the various navigation APIs that SwiftUI provides are very much centered around direct user input — that is, navigation that’s handled by the system in response to events like button taps and tab switching. However, sometimes we might want to take more direct control over how an app’s navigation is performed, and although…

    Read More

  • Podcast: “The magic of Augmented Reality”, with special guest Roxana Jula

    Roxana Jula joins John to discuss Apple’s various tools, frameworks, and APIs for building Augmented Reality experiences. How to get started building AR-based apps, what’s the current state of AR on Apple’s platforms, and how might that change if Apple were to introduce dedicated AR hardware in the future? Sponsors Stream: Build scalable in-app chat…

    Read More

  • Conditional compilation within Swift expressions

    New in Swift 5.5: It’s now possible to conditionally compile postfix member expressions using Swift’s #if compiler directive. Let’s take a look at what kinds of situations that this new feature could be really useful in. Working around platform differences Although many of the built-in APIs and frameworks work exactly the same way across Apple’s…

    Read More