Pod lib lint Error: Warn Swift Version

跟風遠走 提交于 2019-12-24 20:18:06

问题


Every time I run pod lib lint file.podspec I receive this storage warning and I can't figure out how to fix it


回答1:


The .swift-version is a file that serves as a hint for cocoapods to know which version of Swift your pod target, for the given branch/commit/tag.

The content of the file should exclusively contain the Swift version your pod targets, so 4.2 for example if you target Swift 4.2. You can easily create such a file by navigating to the podspec's folder using the Terminal app, and then write:

echo '4.2' > .swift-version

(replace 4.2 with the Swift version you target)

You can find an example of such a file on Sourcery's repository: https://github.com/krzysztofzablocki/Sourcery/blob/master/.swift-version




回答2:


You won't receive this warning if you are using CocoaPods 1.7.0.beta.1 or newer because the .swift-version file was deprecated, see this link for more details. Use the swift_versions attribute to specify the Swift version:

s.swift_versions = ['5.0']


来源:https://stackoverflow.com/questions/47887487/pod-lib-lint-error-warn-swift-version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!