LoginSignup
4
4

More than 5 years have passed since last update.

Xcode8でのSwift3対応でPodfile周りでやったこと

Posted at

概要

XCode8にアップデートしてライブラリ周りでビルド通らず困った時にやった対応の備忘録。

動作環境

XCode 8.0

内容

Swiftのバージョン指定を追加する

Use Legacy Swift Language Version” (SWIFT_VERSION) is required...

っていうメッセージでビルドがこける時

Podfile
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end

Podfileの最後に上記を加えます。
これでpod update をした時にSwift3.0としてビルドしてくれるようになります。

リポジトリ指定を追加する

上記を行って、ビルドエラーが出るライブラリについてはSwift3対応のリポジトリがある(と思う)ので、それを確認してPodfileの指定に追加します。

Podfile
pod "Instructions", :git => "https://github.com/ephread/Instructions.git", :branch => "swift3"

最後の":branch" の指定が取得対象のリポジトリの指定になっているので、Swift3用のリポジトリを指定してあげます。
ライブラリによってbranch名は違うと思うので、各ライブラリのgithubリポジトリで確認してください。
これで再度 pod update かけたあとに Clean → Build で通ればOKです。

参考

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4