In SwiftUI, views can be driven by an @Published property that’s part of an ObservableObject. If you’ve used SwiftUI and @Published before, following code should look somewhat familiar to you: class DataSource: ObservableObject { @Published var names = [String]() } struct NamesList: View { @ObservedObject var dataSource: DataSource var body: some View { List(dataSource.names, id: […]
Read post
Subscribe to my newsletter and never miss a post
Recent articles
Jump to a random postIgnore first number of elements from a publisher in Combine
Published on: June 19, 2020If you have a Combine publisher and you want to ignore the first n elements that are published by that publisher, you can use the dropFirst(_:) operator. This operator will swallow any values emitted until the threshold you specify is reached. For example, dropFirst(1) will ignore the first emitted value from a publisher: [1, 2, […]
Read postRecursively execute a paginated network call with Combine
Published on: June 15, 2020Last week, my attention was caught by a question that Dennis Parussini asked on Twitter. Dennis wanted to recursively make calls to a paginated API to load all pages of data before rendering UI. Since I love Combine and interesting problems I immediately started thinking about ways to achieve this using a nice, clean API. […]
Read postA Double and Float are both used to represent decimal numbers, but they do so in slightly different ways. If you initialize a decimal number in Swift using as shown below, the Swift compiler will assume that you meant to create a Double: let val = 3.123 // val is inferred to be Double The […]
Read postProperty wrappers are a feature that was introduced in Swift 5.1 and they play a huge role in SwiftUI and Combine which are two frameworks that shipped alongside Swift 5.1 in iOS 13. The community was quick to create some useful examples that were embraced by folks relatively quickly. As a user of property wrappers, […]
Read postThis week I wanted to write about something non-technical. And while the topic of this week’s post isn’t a technical one, I think it’s an important topic for developers who want to expand their knowledge, and deepen their skills. I have been a developer professionally for more than ten years at this point and in […]
Read postThere are several ways to handle errors in Combine. Most commonly you will either use catch or replaceError if you want to implement a mechanism that allows you to recover from an error. For example, catch is useful if you want to retry a network operation with a delay. The catch and replaceError operators look […]
Read postCombine comes with a handy retry operator that allows developers to retry an operation that failed. This is most typically used to retry a failed network request. As soon as the network request fails, the retry operator will resubscribe to the DataTaskPublisher, kicking off a new request hoping that the request will succeed this time. […]
Read postReclaim disk space by deleting old iOS simulators and Device Support files
Updated on: November 26, 2020After using a MacBook that runs Xcode for a few years it’s likely that your disk space is starting to fill up good. A large part of this disk space can be occupied by Device Support files that are used by Xcode for older iOS versions, or by iOS simulators that are no longer available […]
Read postThrottle network speeds for a specific host in Charles
Published on: May 21, 2020Sometimes you’ll want to test whether your app works properly under poor networking conditions. One way to test this is Apple’s Network Link Conditioner. Unfortunately, this will slow internet speeds for your entire machine to a crawl which can be counterproductive. Especially if you want to throttle your app for a longer period of time. […]
Read postExpand your learning with my books

Learn everything you need to know about Swift Concurrency and how you can use it in your projects with Practical Swift Concurrency. It contains:
- Eleven chapters worth of content.
- Sample projects that use the code shown in the chapters.
- Free updates for future iOS versions.
The book is available as a digital download for just $39.99!
Learn more