Hi, my name is Donny
I'm a curious, passionate iOS Developer from The Netherlands who loves learning and sharing knowledge.
Take a look at my books

Practical Combine
Practical Combine is a book aimed at intermediate to advanced developers who want to learn more about Apple's Combine framework. This book takes you all the way from the basics to building custom Combine publishers using Practical, useful examples that you can start using immediately.
Buy on Gumroad
Practical Core Data
Practical Core Data is for intermediate to advanced developers who want to learn more about Core Data. Whether you're new to Core Data, or tried using it years ago, you'll find that Practical Core Data introduces you to all the essentials to get you up and running with the framework.
Buy on GumroadRecent articles
The basics of structured concurrency in Swift explained
March 17, 2023Swift Concurrency heavily relies on a concept called Structured Concurrency to describe the relationship between parent and child tasks. It finds its basis in the fork join model which is a model that stems from the sixties. In this post, I will explain what structured concurrency means, and how it plays an important role in Swift Concurrency. We’ll start by looking at the concept from a high level before looking at a few examples of Swift code that illustrates the...
Read more...Setting up a simple local web socket server
January 24, 2023Every once in a while I find myself writing about or experimenting with web sockets. As an iOS developer, I’m not terribly familiar with setting up and programming servers that leverage web sockets beyond some toy projects in college. Regardless, I figured that since I have some posts that cover web sockets on my blog, I should show you how I set up the socket servers that I use in those posts. Before you read on, I’m going to need...
Read more...Iterating over web socket messages with async / await in Swift
January 24, 2023In iOS 13, we gained the ability to easily send and receive data using web sockets through URLSession. With async/await, we gained the ability to fetch data from servers using the await keyword and we can iterate over asynchronous sequences using async for loops. We can even read data from a URL one line at a time by calling the lines property on URL: let url = URL(string: "https://donnywals.com")! for try await line in url.lines { // use line }...
Read more...Understanding Swift Concurrency’s AsyncStream
January 2, 2023In an earlier post, I wrote about different ways that you can bridge your existing asynchronous code over to Swift’s new Concurrency system that leverages async / await. The mechanisms shown there work great for code where your code produces a single result that can be modeled as a single value. However in some cases this isn’t possible because your existing code will provide multiple values over time. This is the case for things like download progress, the user’s current...
Read more...Providing a default value for a SwiftUI Binding
November 15, 2022Sometimes in SwiftUI apps I’ll find that I have a model with an optional value that I’d like to pass to a view that requires a non optional value. This is especially the case when you’re using Core Data in your SwiftUI apps and use auto-generated models. Consider the following example: class SearchService: ObservableObject { @Published var results: [SearchResult] = [] @Published var query: String? } Let me start by acknowledging that yes, this object can be written with a...
Read more...Enabling Concurrency warnings in Xcode 14
September 13, 2022If you want to make sure that your code adopts Swift concurrency as correctly as possible in Swift 5.7, it's a good idea to enable the Strict Concurrency Checking (SWIFT_STRICT_CONCURRENCY) in your project. To do this, select your project's target and navigate to the Build Settings tab. Make sure you select All from the list of settings that is shown (Basic is the default) and type Strict Concurrency in the searchbar to find the Strict Concurrency Checking build setting. The...
Read more...