Treat warnings as errors in Swift

Does anyone know if it is possible to have Xcode treat warnings as errors when writing in Swift?


I prefer to write production code with this setting on, and it works well in Objective-C code, but seems not available to Swift code. I have filed a radar (22009631) some time ago but there has been no response or updates (it was filed July last year), but maybe the question is better suited to https://bugs.swift.org?

Replies

In Xcode 7.3.1 I'm able to do this by setting

OTHER_SWIFT_FLAGS="-warnings-as-errors"


I have not tried in earlier versions.