Pods written in Swift can only be integrated as frameworks; add use_frameworks!
to your Podfile or target to opt into using it. The Swift Pods being used are:
Box, ReactiveCocoa, and Result
大概意思是:蘋果不允許建包含swift的靜態(tài)庫,不同于OC可以使用平臺(tái)版本的語言版本。
Podfile的配置文件為:
一開始我安裝oc的配置方法:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0' target 'RWReactivePlayground' do
pod 'ReactiveCocoa', '~> 3.0'
end
解決方法:#use_frameworks!個(gè)別需要用到它,比如reactiveCocoa
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'RWReactivePlayground' do
pod 'ReactiveCocoa', '~> 3.0' use_frameworks!
end
對(duì)于多個(gè)框架的添加
Podfile的配置文件為:
platform:ios,'8.0'
def
pods
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'end
target 'MyApp'do pods
end