1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Xcode 7 - Swift 2プロジェクトをXcode 8.1 - Swift 2.3へ移行する手順

Last updated at Posted at 2016-11-26

概要

Xcode 7.xから8.1にアップデートしつつ、Swift 3にコンバートせず、Swift 2.3で動作させる手順です。
今さら感はありますが備忘として。 

環境

移行前

Items Version
Xcode 7.3
Swift 2.2

移行後

Items Version
Xcode 8.1
Swift 2.3

ライブラリ

  • Carthage
    • Alamofire
    • SwiftyJSON
    • SVProgressHUD
    • Realm Swift

手順

1.プロジェクトを開く

Xcode 8でプロジェクトを開くと、以下の2つのダイアログが表されます。
いずれも、「Later」をクリックします。

1.png

2.png

2.Build Settingsを変更する

「TARGETS」-「Build Settings」タブの「Use Legacy Swift Language Version」を「Yes」に変更します。

スクリーンショット 2016-11-26 16.10.56.png

3.Cartfileを修正する

各ライブラリの定義をSwift 2.3対応バージョン指定に修正します。

こちら↓を参考にさせていただきました。
http://qiita.com/beatspace/items/5dc4c45f2aa690021a37

Cartfile(修正前)
github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "SVProgressHUD/SVProgressHUD"
github "realm/realm-cocoa"
Cartfile(修正後)
github "Alamofire/Alamofire" == 3.5.0
github "SwiftyJSON/SwiftyJSON" == 2.3.1
github "SVProgressHUD/SVProgressHUD"
github "realm/realm-cocoa" "master"

4.carthage update

アタマに「TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3」をつけて実行します。

TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage update --platform iOS --no-use-binaries

スクリーンショット 2016-11-26 16.12.41.png

以上で実行可能になります。

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?