I'm Trevor, a Swift developer working mainly in iOS 📱. This blog is where I share my learnings, thoughts & insights. Thanks for reading!

Featured Posts:

CATEGORY

Swift

Shortcut for ".compactMap { $0 }" in Combine (Swift)

I have this pet peeve where I don’t like to type out .compactMap { $0 } every time I want to remove nils from a publisher. Today I finally took some time to find a good alternative & I really like how ...

Read more

Refactor A Private Callback Based API To Use Async/Await

Last time we talked about how to refactor a callback based network call into an async/await based call. In that case, we had access to the underlying networking code & updated the entire chain of method calls to use async/await...

Read more

Refactor A Callback Based API To Use Async/Await

Recently I’ve refactored a few callback based network requests to use Swift’s new Async / Await syntax. Let’s take a look at how we can take a conventional callback based API method and improve its readability and simplicity...

Read more

I made a Swift syntax highlighting app

If you’re a Swift blogger like me, you probably have to come up with some easy way to highlight code syntax on the web. After some searching I came across Splash which was created by the relatively famous John Sundell (he uses...

Read more

My Realistic Physics Contribution to ConfettiSwiftUI

I was recently working on my Wordie app & needed some confetti to celebrate a victory when the user guesses the correct word. I built the app completely in SwiftUI so I started searching for a confetti library I could drop in...

Read more

Building your first widget - Step 2

In step 1 we created the widget extension target & got it running on the simulator. Now let’s look at the basic parts of a widget. You’ll notice that Apple created a folder with your widget name & made a template file for you...

Read more

Building your first widget - Step 1

It was pretty cool when Apple gave us widgets with iOS 14. Finally we could customize our home screens with something more than just app icons! This is a simple walkthrough of how to add a widget to your app & what to put in...

Read more

Handle Multiple Async Callbacks with DispatchGroup

The first time I heard of a DispatchGroup was a few years into my iOS career - my teammate mentioned that he used it in his pull request code. He said this DispatchGroup made it easy to wait for multiple async callbacks...

Read more