Xcode Tips 💡

The more you know... 😎

⬅️ Go Back

✏️ Contribute

Compiler Flags

Measuring build times for type checking

You can use the Swift compiler flags -warn-long-function-bodies and -warn-long-expression-type-checking to emit warnings for functions or expressions that take longer than a set time to type check. Surfacing these within your projects can help improve and manage type checking times which contribute to overall build times.

Source: Jesse Squires

Swift Concurrency flags

If you’re writing Swift concurrency code, add these compiler flags:

-Xfrontend -warn-concurrency -Xfrontend -enable-actor-data-race-checks

(in Xcode: Other Swift Flags)

Warnings in Swift 5.5 identify unsafe constructs, will become errors in Swift 6.

Swift Forums: Concurrency in Swift 5 and 6

Source: Ole Begemann