1.創(chuàng)建帶有 CocoaPods的文件,首先創(chuàng)建一個 RacTest的工程,接下來在終端輸入
cd /Users/sfm/desktop/RacTest
touch Podfile
vim Podfile
接下來证鸥,要到剛剛創(chuàng)建的 Podfile 中寫入 rac
//rac 最低要求 ios8
platform :ios, '9.0'
pod "ReactiveCocoa", "~>4.0.4-alpha-4"
use_frameworks!
//按下 esc ,:wq 保存退出
一旦你保存這個文件,返回到終端窗口并發(fā)出以下命令:
pod install
應(yīng)該看到一個類似于下面的輸出結(jié)果:
Analyzing dependencies
Downloading dependencies
Installing ReactiveCocoa (4.0.4-alpha-4)
Generating Pods project
Integrating client project
[!] From now on use RWReactivePlayground.xcworkspace
.
This indicates that the ReactiveCocoa framework has been downloaded, and CocoaPods has created an Xcode workspace to integrate the framework into your existing application.
這表明 ReactiveCocoa 框架已經(jīng)被下載,和 CocoaPods 已經(jīng)創(chuàng)建了一個集成這個框架到你現(xiàn)有應(yīng)用程序的 Xcode 工作區(qū)涝缝。