iOS项目引入ReactiveCocoa

·  阅读 1366

1.ReactiveCocoa 5.0以后将 RAC 拆分为四个库

ReactiveCocoa github地址

ReactiveCocoa github四个重要的库

序号 适用范围
1 ReactiveCocoa 纯Swift项目直接依赖
2 ReactiveObjC 纯OC项目直接依赖
3 ReactiveSwift OC和Swift混编时要依赖
4 ReactiveObjCBridge OC和Swift混编时要依赖

2.纯Swift项目直接依赖

podfile如下

platform :ios, '9.0'
project './ractest.xcodeproj'
target 'ractest' do
pod 'ReactiveCocoa'
end
复制代码

执行pod install后发现安装了两个库ReactiveCocoaReactiveSwift

Analyzing dependencies
Downloading dependencies
Installing ReactiveCocoa (10.1.0)
Installing ReactiveSwift (6.1.0)
Generating Pods project
Integrating client project
复制代码

3.纯OC项目直接依赖

podfile如下

platform :ios, '9.0'
project './ractest.xcodeproj'
target 'ractest' do
pod 'ReactiveObjC'
end
复制代码

执行pod install后发现安装了一个库ReactiveObjC

Analyzing dependencies
Downloading dependencies
Installing ReactiveObjC (3.1.1)
Generating Pods project
Integrating client project
复制代码

3.OC和Swift混编项目

podfile如下

use_frameworks!
platform :ios, '9.0'
project './ractest.xcodeproj'
target 'ractest' do
pod 'ReactiveCocoa'
pod 'ReactiveObjC'
pod 'ReactiveObjCBridge'
end
复制代码

执行pod install后发现安装了四个库ReactiveCocoa,ReactiveSwift,ReactiveObjC,ReactiveObjCBridge

安装了四个库

Analyzing dependencies
Downloading dependencies
Installing ReactiveCocoa (10.1.0)
Installing ReactiveObjCBridge (6.0.0)
Installing ReactiveSwift (6.1.0)
Generating Pods project
Integrating client project
复制代码
分类:
iOS
标签:
收藏成功!
已添加到「」, 点击更改