【发布时间】:2020-09-15 12:08:13
【问题描述】:
我刚刚升级到 11.5。编译器现在抛出 IOS 图表的警告 (var -> let)。是否可以仅为 Charts 模块删除这些,即我不想删除我自己代码的其余部分的警告(我不愿意进入 Charts 模块并更改源,即使更改是微不足道的) .
【问题讨论】:
标签: swift xcode11 ios-charts
我刚刚升级到 11.5。编译器现在抛出 IOS 图表的警告 (var -> let)。是否可以仅为 Charts 模块删除这些,即我不想删除我自己代码的其余部分的警告(我不愿意进入 Charts 模块并更改源,即使更改是微不足道的) .
【问题讨论】:
标签: swift xcode11 ios-charts
转到目标的Build Settings 并将Inhibit All Warnings 设置为YES。
或
如果您使用的是 cocoapods,您可以通过将这些行添加到您的 Podfile 中来自动将其设置为 YES
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = "YES"
end
end
end
或
只需在您的Podfile 顶部声明inhibit_all_warnings!。
如果您想禁用/启用特定 pod 的警告,请在 pod 行中使用 :inhibit_warnings => true 或 :inhibit_warnings => false。然后你应该执行pod install
platform :ios
# ignore all warnings from all pods
inhibit_all_warnings!
# ignore warnings from a specific pod
pod 'Charts', :inhibit_warnings => true
【讨论】: