16

When building my project I have a lot of warnings from CocoaPods Pods. So other projects that I don't have control of.

What is the suggested way to handle this? I'd prefer to have Xcode only display warnings related to my project. It just gets to be too much if it displays warnings related to projects I don't have control over.

Charlie Fish
  • 18,491
  • 19
  • 86
  • 179
  • duplication of http://stackoverflow.com/questions/13208202/ignore-xcode-warnings-when-using-cocoapods/13209057#13209057 – Pavlo Shadov May 17 '17 at 20:53

1 Answers1

36

There is two way to get it done:

Method 1

  1. Go to your pod project's Build Settings tab
  2. Search for inhibit_all_warnings flag
  3. Set it to YES

It'll suppress all the warning related to the pod project. But when you do next pod install the flag will be reset to NO.

Inhibit all warning

Method 2

In your podfile specify inhibit_all_warnings! key like following: (This will avoid the inhibit warning flag resetting with each pod install issue. Do a pod install after adding this flag.).

platform :ios, '9.0'
inhibit_all_warnings!

target 'MyApp' do
   # Your Pods
end

Reference: Podfile Syntax

Community
  • 1
  • 1
Midhun MP
  • 103,496
  • 31
  • 153
  • 200
  • Still showing warnings. I should mention it's not like CocoaPods warnings. It's like warnings inside of the pods themselves. For example: `Pods/FacebookShare/Sources/Share/Content/Link/LinkShareContent.swift:121:13: 'contentDescription' is deprecated: 'contentDescription' is deprecated from Graph API 2.9` or `Pods/DGElasticPullToRefresh/DGElasticPullToRefresh/DGElasticPullToRefreshLoadingViewCircle.swift:35:32: 'M_PI' is deprecated: Please use 'Double.pi' or '.pi' to get the value of correct type and avoid casting.` – Charlie Fish May 17 '17 at 20:42
  • 1
    Ok looks like method 2 works. For some reason method 1 was still throwing warnings. Thank you very much! – Charlie Fish May 17 '17 at 20:50
  • 1
    @CharlieFish: Both methods are working for me, glad to know method 2 worked for you :) Happy Coding !!! – Midhun MP May 18 '17 at 05:33