Here’s a handy little ditty I cooked up today after getting frustrated with Swift’s compiler warnings. Tested on Xcode 8.3.3.
I don’t like turning them off manually in the build settings, as it’s too easy to forget, but being able to quickly turn them off and on again via hotkey means I can get a bit of peace and quiet and stop the crashes that sometimes occur as the compiler chokes on incomplete code chunks.
A longer preamble: http://applehelpwriter.com/2017/07/15/toggle-swift-compiler-warnings/
tell application id "com.apple.dt.Xcode" -- Xcode.app tell its front document tell its front project tell its front target tell its build configuration "Debug" set b to build setting "SWIFT_SUPPRESS_WARNINGS" if b's value is "NO" then set b's value to "YES" else set b's value to "NO" end if display notification "Suppress Warnings was set to " & b's value with title "Swift Compiler - Warnings Policies" end tell end tell end tell end tell end tell
I haven’t tested this on Xcode 9 beta yet.