Learn more about Quick Tip

What is @escaping in Swift?

Updated on: January 20, 2025

If you’ve ever written or used a function that accepts a closure as one of its arguments, it’s likely that you’ve encountered the @escaping keyword. When a closure is marked as escaping in Swift, it means that the closure will outlive, or leave the scope that you’ve passed it to. Let’s look at an example […]

Read post

Using KeyPaths as functions in Swift 5.2

Published on: February 26, 2020

One of Swift 5.2’s new features is the ability to use KeyPaths as functions. This can be extremely useful in cases where you’d only return the value of a certain KeyPath in a closure. Let’s look at a pre-Swift 5.2 example where this is the case: // Swift 5.1 and earlier struct User { let […]

Read post

Adding default values to subscript arguments in Swift 5.2

Published on: February 19, 2020

The ability to define custom subscripts in Swift is really powerful. It allows us to write very natural and concise code. Consider the following example of a Grid with a custom subscript: struct Grid { let items : [[GridItem]] subscript(x x: Int, y y: Int) -> GridItem? { guard !items.isEmpty, (items.startIndex…items.index(before: items.endIndex)).contains(x) else { return […]

Read post

Testing push notifications in the Simulator with Xcode 11.4

Updated on: August 19, 2020

For years we’ve had to resort to using physical devices when testing push notifications. With Xcode 11.4, Apple finally gives developers the tools needed to test push notifications on the iOS Simulator. I’m going to assume you already know how to add push notifications to your app. If you’ve never added push notifications to an […]

Read post

Five ways to get better at receiving feedback

Published on: February 5, 2020

When I just started my career as a developer there was a lot I didn’t know yet. There also were a lot of things I didn’t understand or had never done before. I have always been lucky enough to work in places where I was able to learn and grow as needed, and most importantly, […]

Read post

Updating UI with assign(to:on:) in Combine

Published on: January 29, 2020

So far in my series of posts about Combine, we have focussed on processing values and publishing them. In all of these posts, I used the sink method to subscribe to publishers and to handle their results. Today I would like to show you a different kind of built-in subscriber; assign(to:on:). This subscriber is perfect […]

Read post

Debugging network traffic with Charles

Updated on: February 10, 2020

When you perform a URL Request in your app, you typically configure the request in your code and when it’s all set up you pass it off to a URLSession data task, and the request should succeed if everything goes as expected. When the request is misconfigured, the server will hopefully return a useful error […]

Read post

Tips to ask better questions

Published on: January 15, 2020

As developers, we all get stuck sometimes. When this happens we start searching for solutions on Google, or we ask questions on Stackoverflow, on the Swift forums, the iOS Developers Slack community or other places. Over the past couple of years, I have been actively trying to help people solve problems they were stuck on […]

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