iOS项目引入ReactiveCocoa

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

ReactiveCocoa github地址
iOS项目引入ReactiveCocoa_第1张图片

序号 适用范围
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
iOS项目引入ReactiveCocoa_第2张图片

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开发)