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 Swift Concurrency
Learn everything you need to know to make optimal use of Swift Concurrency in your applications. This book covers everything from awaiting asynchronous method calls to building your own highly concurrent systems. It’s a great introduction for those looking to familiarize themselves with everything Swift Concurrency has to offer.
Buy on GumroadPractical 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 GumroadPractical 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
Jump to a random postSolving "Main actor-isolated property can not be referenced from a Sendable closure" in Swift
January 10, 2025When you turn on strict concurrency checking or you start using the Swift 6 language mode, there will be situations where you run into an error that looks a little bit like the following: Main actor-isolated property can not be referenced from a Sendable closure What this error tells us is that we're trying to use something that we're only supposed to use on or from the main actor inside of a closure that's supposed to run pretty much anywhere....
Read more...Is 2025 the year to fully adopt Swift 6?
January 9, 2025When Apple released Xcode 16 last year, they made the Swift 6 compiler available along with it. This means that we can create new projects using Swift 6 and its compile-time data race protections. However, the big question for many developers is: Is 2025 the right time to adopt Swift 6 fully, or should we stick with Swift 5 for now? In this post, I won’t give you a definitive answer. Instead, I’ll share my perspective and reasoning to help...
Read more...Sending vs Sendable in Swift
December 18, 2024With Swift 6, we have an entirely new version of the language that has all kinds of data race protections built-in. Most of these protections were around with Swift 5 in one way or another and in Swift 6 they've refined, updated, improved, and expanded these features, making them mandatory. So in Swift 5 you could get away with certain things where in Swift 6 these are now compiler errors. Swift 6 also introduces a bunch of new features, one...
Read more...Mocking a network connection in your Swift Tests
December 12, 2024Unit tests should be as free of external dependencies as possible. This means that you want to have full control over everything that happens in your tests. For example, if you're working with a database, you want the database to be empty or in some predefined state before your test starts. You operate on the database during your test and after your test the database can be thrown away. By making your tests not depend on external state, you make...
Read more...Testing completion handler based code in Swift Testing
December 4, 2024Swift's new modern testing framework is entirely driven by asynchronous code. This means that all of our test functions are async and that we have to make sure that we perform all of our assertions “synchronously”. This also means that completion handler-based code is not as straightforward to test as code that leverages structured concurrency. In this post, we’ll explore two approaches that can be useful when you’re testing code that uses callbacks or completion handlers in Swift Testing. First,...
Read more...Testing requirements with #require in Swift Testing
November 28, 2024In a previous post, I wrote about using the #expect macro to ensure that certain assertions you want to make about your code are true. We looked at testing boolean conditions as well as errors. In this post, I would like to take a look at a macro that goes hand-in-hand with #expect and that is the #require macro. The #require macro is used to ensure that certain conditions in your test are met, and to abort your test if...
Read more...