In Xcode, how to suppress all warnings in specific source files?

后端 未结 3 1714
北荒
北荒 2020-11-28 02:39

In my application I use 3rd party code that triggers some warnings. I reviewed them and they can be safely ignored.

Now I want to \"mark\" a file somehow, so Xcode w

3条回答
  •  醉话见心
    2020-11-28 03:29

    This works for Xcode 10.2+ and Swift 5

    Manual fix:

    Add -w -Xanalyzer -analyzer-disable-all-checks to the problematic file from Xcode > Project > Targets > Compile Sources > Double click the file where you want to turn off warnings.

    Cocoapods Fix:

    If you're trying to suppress warnings from a problematic pod, you can automatically suppress all warnings from the dependency with the inhibit_warnings flag in your podfile:

    pod 'Kingfisher', '~> 4.6', :inhibit_warnings => true
    

提交回复
热议问题