Reducing Xcode Build Times for Unit Tests and SwiftUI Preview Builds

In this article, I want to walk through how I reduced the incremental build times in my app from ~24 seconds to ~0.3 seconds when building to run Unit Tests or SwiftUI Previews. I hope that someone may be able to take the same approach to help reduce these build times in their project.

Why Worry?

This may seem obvious, be quickly I would like to talk about the benefits of reducing these build times in your project. In my project, we had gotten to a point with SwiftUI Previews that…