Arrays in Swift can hold on to all kinds of data. A common desire developers have when they use arrays, is to remove duplicate values from their arrays. Doing this is, unfortunately, not trivial. Objects that you store in an array are not guaranteed to be comparable. This means that it’s not always possible to […]
Read post
Subscribe to my newsletter and never miss a post
Learn more about Quick Tip
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 postYou have probably seen and used a property list file at some point in your iOS journey. I know you have because every iOS app has an Info.plist file. It’s possible to create and store your own .plist files to hold on to certain data, like user preferences that you don’t want to store in […]
Read postUsing KeyPaths as functions in Swift 5.2
Published on: February 26, 2020One 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 postAdding default values to subscript arguments in Swift 5.2
Published on: February 19, 2020The 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 postFor 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 postFive ways to get better at receiving feedback
Published on: February 5, 2020When 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 postUpdating UI with assign(to:on:) in Combine
Published on: January 29, 2020So 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 postWhen 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 postTips to ask better questions
Published on: January 15, 2020As 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 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 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