Using clang* I could do
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// ...
#pragma clang diagnostic pop
However this does not work in swift.
So how to do suppress warnings in Swift?
EDIT: below instruction is for "deprecated declarations" warning. If you want to suppress different warnings then you should use flag relevant for the warning. Most of you probably use Clang, and it's warning flags can be found here. So if you want to suppress for example -Wunused-argument
you will write it with "no": -Wnounused-argument
.
If you want to disable compiler warnings then go to Project -> Target -> Build Settings and add flag with no prefix to other warning flags:
If you want to disable warnings for separate file: Go to Project and pick relevant Target -> Build Phases -> Compile Sources and flag separate file: