目录
前言
这篇文章主要讲解RxSwift中的一些常用术语和安装方式。
一、安装方式
RxSwift 不包含任何外部依赖。
这些是当前支持的安装选项:
1.CocoaPods方式安装
我们可以通过配置podfile文件类安RxSwift
# Podfile
use_frameworks!target 'YOUR_TARGET_NAME' do
pod 'RxSwift', '6.9.0'
pod 'RxCocoa', '6.9.0'
end# RxTest and RxBlocking make the most sense in the context of unit/integration tests
target 'YOUR_TESTING_TARGET' do
pod 'RxBlocking', '6.9.0'
pod 'RxTest', '6.9.0'
end
把YOUR_TARGET_NAME替换成您的项目名称即可。
然后终端执行pod install命令即可。
2.XCFrameworks
每个从RxSwift 6开始的版本都包含*.xcframework框架二进制文件。
只需将所需的框架二进制文件拖到项目中。
3.Carthage
把下面的代码添加到Cartfile文件中。
github "ReactiveX/RxSwift" "6.9.0"
然后终端执行下面的代码: