1.Xcode新建空白项目

2.Terminal进入项目根目录
cd /Users/zhaoyingxin/Documents/solozyx/CocoaPods/ReactiveCocoaEmptyProject
执行 pod init 命令
pod init
就在目录 ReactiveCocoaEmptyProject
下生产了 Podfile
文件
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ReactiveCocoaEmptyProject' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for ReactiveCocoaEmptyProject
target 'ReactiveCocoaEmptyProjectTests' do
inherit! :search_paths
# Pods for testing
end
target 'ReactiveCocoaEmptyProjectUITests' do
inherit! :search_paths
# Pods for testing
end
end

修改 Podfile
文件内容为
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ReactiveCocoaEmptyProject' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
# Pods for ReactiveCocoaEmptyProject
# target 'ReactiveCocoaEmptyProjectTests' do
# inherit! :search_paths
# Pods for testing
# end
# target 'ReactiveCocoaEmptyProjectUITests' do
# inherit! :search_paths
# Pods for testing
# end
pod 'ReactiveCocoa', '~>4.2.1'
end
3.导入RAC框架
pod install



网友评论