Recent articles

Jump to a random post

Using custom publishers to drive SwiftUI views

Updated on: September 30, 2020

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

Ignore first number of elements from a publisher in Combine

Published on: June 19, 2020

If 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 post

Recursively execute a paginated network call with Combine

Published on: June 15, 2020

Last 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 post

What’s the difference between Float and Double in Swift

Updated on: July 31, 2020

A 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 post

Understanding property wrappers in Swift with examples

Updated on: July 7, 2025

Property 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 post

Five tips to help you become a well-rounded developer

Updated on: January 25, 2024

This 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 post

Retrying a network request with a delay in Combine

Updated on: May 5, 2021

Combine 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 post

Throttle network speeds for a specific host in Charles

Published on: May 21, 2020

Sometimes 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 post

Expand your learning with my books

Practical Swift Concurrency header image

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