2016-11-16 37 views
2

我有一個Objective-C庫,我正在嘗試將podspec更新爲cocoapods。當我這樣做「莢規範皮棉」命令,我收到以下錯誤:Cintapods的棉絨失敗

[!] The spec did not pass validation, due to 1 error. 
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: 
    `echo "2.3" > .swift-version`. 

這裏是我的podspec文件:

Pod::Spec.new do |s| 

    s.name   = "OSwitch" 
    s.version  = "0.2.0" 
    s.license  = { :type => "MIT", :file => "LICENSE" } 
    s.summary  = "OSwitch is a customisable switch control writen in Objective C." 
    s.homepage  = 'https://github.com/OyaSaid/OSwitch' 
    s.source   = { :git => 'https://github.com/OyaSaid/OSwitch.git', :tag => s.version.to_s } 
    s.platform  = :ios, "7.0" 
    s.ios.frameworks = ['UIKit', 'Foundation'] 
    s.source_files = 'OSwitch/Classes/**/*.{h,m}' 
    s.requires_arc = true 
end 

時,我有一個客觀的C庫爲什麼這個節目。我該如何解決這個問題?

感謝

回答

2

這表明,因爲你可以在你的莢同時使用SWIFT和Objc語言。 終端只需運行下面的命令:

`echo "2.3" > .swift-version` 

替換爲「2.3」,在Xcode中的當前版本的雨燕,如果你在3.1例如與「3.1」代替。它會在您的pod-project文件夾中創建一個swift版本的文件。然後你可以運行lint命令來驗證你的podspec。

+0

謝謝!有效。 – Oya

+0

也可以將它指定爲參數,比如'pod spec lint --swift-version = 2.3' –

+0

嘿,我在終端中使用了這個命令,但沒用。沒有快速的版本文件被創建。你可以解釋或編輯你的答案,並附上一些截圖。 –