Paul Cantrell Paul Cantrell - 1 month ago 18
Swift Question

Swift 3 CocoaPod does not pass lint

I’m upgrading a CocoaPod to Swift 3. It compiles and runs just fine, but

pod lib lint
fails with numerous compiler errors, because the linter tries to compile everything as Swift 2.3.

Attempts to set
SWIFT_VERSION
in the podspec or change “Use Legacy Swift Language Version” in my framework’s Xcode project do not solve the issue.

How do I make the pod linter use Swift 3?

Answer

It turns out CocoaPods now looks for a .swift-version file, as of 1.1.0.rc.2 (changelog). If the file contains 3.0, linting will work:

echo 3.0 > .swift-version
Comments