2016-09-28 47 views
1

我目前正在將iOS應用程序從Swift 2.2升級到3.0。我已將所有Pod的依賴關係指向Swift 3版本並遷移了我的代碼。然而,當我運行pod install,並嘗試打開我的工作區時,Xcode仍希望我的「豆莢」項目轉換爲最新的斯威夫特語法:將使用Cocoapods 1.0.1從Swift 2.2移植到3.0的iOS應用程序

項目「豆莢」具有包含源代碼的開發目標早期版本的Swift。

Convert to Current Swift Syntax

但我已經升級了我的依賴於他們的雨燕3.0的版本。是什麼賦予了?

(這是一個典型Q &一對,以幫助誰遇到這個問題,未來的用戶)

回答

3

我曾就此問題與的CocoaPods 1.0.1地方,我需要手動指定安裝目標爲SWIFT_VERSION 3.0:

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):

source 'https://github.com/CocoaPods/Specs.git' 

use_frameworks! 

target 'MyApp' do 
    pod "MyPod", :path => "../" 
end 

target 'MyApp_Tests' do 
    pod "MyPod", :path => "../" 
end 

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 

問題#5521 - Compiler Version for Xcode 8幫助您找到此解決方法。

+0

或者,你知道的,只是更新到1.1.0.rc.2。 –

+0

@JonShier我必須訂閱特定的測試版頻道才能獲得候選版本?我沒有看到正常的「pod更新」 – JAL

1

我建議使用他們的發佈候選版

sudo gem install cocoapods --pre 

然後做一個吊艙安裝再次

+0

對,但是如果你的團隊不支持預發佈和發佈候選版本的Cocoapods(並且在1.0.1上停留),那麼這個是不是一個可行的解決方案。 – JAL

+0

使用Swift Package Manager? –

相關問題