Recent articles

Jump to a random post

Solving “reference to var myVariable is not concurrency-safe because it involves shared mutable state” in Swift

Published on: August 15, 2024

Once you start migrating to the Swift 6 language mode, you’ll most likely turn on strict concurrency first. Once you’ve done this there will be several warings and errors that you’ll encounter and these errors can be confusing at times. I’ll start by saying that having a solid understanding of actors, sendable, and data races […]

Read post

Solving “Converting non-sendable function value may introduce data races” in Swift

Updated on: August 21, 2024

Once you start migrating to the Swift 6 language mode, you’ll most likely turn on strict concurrency first. Once you’ve done this there will be several warings and errors that you’ll encounter and these errors can be confusing at times. I’ll start by saying that having a solid understanding of actors, sendable, and data races […]

Read post

What are Optionals in Swift?

Published on: August 12, 2024

In an earlier article, I explained how variables are defined in Swift using let and var. Both constants (let) and variables (var) in Swift always have a type; it’s what makes Swift a strongly typed language. For example, we could define a String variable like this: // the compiler will know myString is a String […]

Read post

Adding values to the SwiftUI environment with @Entry

Updated on: July 7, 2025

Environment values are a convenient way to pass data down a deep view hierarchy. We can add values to the environment ourselves, but the syntax is clunky and verbose. In this post you’ll learn about the built-in @Entry macro which makes adding new values a breeze.

Read post

Using PreviewModifier to build a previewing environment

Published on: July 10, 2024

Xcode 16 and iOS 18 come with a feature that allows us to build elaborate preview environments using a new PreviewModifier protocol. This protocol allows us to define objects that can create a single context or environment that’s cached and used across your SwiftUI previews. This is useful because it means that you could, for […]

Read post

Mixing colors in SwiftUI and Xcode 16

Updated on: July 22, 2024

SwiftUI in iOS 18 and macOS 15 has gained a new trick; it can mix colors. This means that it’s now possible to take a color and modify it by applying another color to it using a provided percentage. The video below shows how this works: Notice how the large rectangle updates its color to […]

Read post

Using iOS 18’s new TabView with a sidebar

Published on: June 12, 2024

In iOS 18, Apple has revamped the way that tab bars look. They used to be positioned at the bottom of the screen with an icon and a text underneath. Starting with iOS 18, tab bars will no longer be displayed in that manner. Instead, on iPad you will have your tab bar on the […]

Read post

Expand your learning with my books

Practical Swift Concurrency (the video course) header image

Learn everything you need to know about Swift Concurrency and how you can use it in your projects with Practical Swift Concurrency the video course. It contains:

  • About ten hours worth of videos and exercises
  • Sample projects that use the code shown in the videos.
  • FREE access to the Practical Swift Concurrency book
  • Free updates for future iOS and Swift versions.

The course is available on Teachable for just $89

Enroll now