1.創建工程,打開終端cd項目文件路徑:
2.創建pod file文件
(1)在終端輸入:pod search ReactiveCocoa查找版本
(2)終端輸入:vim pod file
# Uncomment this line to define a global platform for your project
platform :ios, ‘8.0’
target ’ReactiveCocoa登錄注冊’ do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'ReactiveCocoa', '~> 4.0.4-alpha-4'
pod 'AFNetworking'
pod 'Masonry'
# Pods for NCube
end
注意粘貼時修改項目名稱? target ’ReactiveCocoa登錄注冊’ do?
3.終端輸入pod install 就可以了
打開工程后會報錯,是關于swift版本問題,如果項目不需要swift語言,將ReactiveCocoa項目下的swift文件全部刪除即可