Check out this thread, which has my specific suggestions and a bunch of info from other folks.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
I recently used the migration wizard to convert a 23 file application from Swift 2x to 3. The result was many warnings such as "Expression implicitly coerced from 'UIView?' to Any" .
Compile time was several minutes.
It seems any file with an error/warning is causing a re-compile of the file with the warning, even if you haven't changed/edited the file since last time you ran a compile. Having now tracked and fixed these warnings, compiling is now incremental on changed files only and down to seconds.
I don't remember seeing this behaviour in XCode 7.
I was able to greatly reduce my swift project compile times by avoiding the use the Nil-Coalescing Operator and string concatenation.
In otherwords where I had something like:
let x = "one" + object.nullableProperty ?? ""
I changed it to
let x = String(format: "one %@", object.nullableProperty ?? "")
My compile times have dropped drastically- from 20 minutes to 20 seconds.
I am so frustrated with the "tortoise" speed of swift compilations. Have ordered my team not to use swift anymore in the next projectS until Apple use it to build it's products and asked HR not to hide programmer who doesn't know obj c Until further notice. It's really funny that Apple do not use swift to build their major products, or they have insider information.
This reminds me on what happened 20 years ago when we used Microsoft Visual C++ to POC a simple dll, it took forever to compile!!!