Reputation: 9324
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?
Upvotes: 8
Views: 2424
Reputation: 36620
I know this was written for Swift 3, but you can do the same to update pods for 4.0:
echo 4.0 > .swift-version
This was done with version 1.3.1 of Cocoapods.
Upvotes: 0
Reputation: 1586
I have this issue when develop SDK which is depending on socket.io-Client-Swift. After type
echo 3.0 > .swift-version
still don't fix my problem.
However, I noticed pod lint use xcodebuild to test whether the framework is ready to be release without error. Make sure you use Xcode8 to build pod lint. For some reason, I install both Xcode7 & Xcode8 and changed my xcodebuild path to xcode7, so the lint won't be pass when I want to make a framework with swift 3.
use the following code to make sure your xcode setting is right.
xcode-select -print-path
if the xcode-select path is not point to xcode8, you should using
xcode-select -switch <path>
set the xcode-select path to xcode8 which is usually in your Applications.
Upvotes: 1
Reputation: 9324
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
Upvotes: 26
Reputation: 138
First you have to update cocoapods to 1.1.0.rc.2 by
[sudo] gem install cocoapods --pre
then as Paul Cantrell says, do
echo 3.0 > .swift-version
in the same dir where the pod spec is
Upvotes: 5