RxSwift aims to be fully compatible with Rx, Reactive Extensions for Microsoft .NET, a mature reactive programming framework that has been ported to many languages, including Java, Scala, JavasScript, and Clojure. Adopting RxSwift thus has the advantage that it will be quite natural for you to use the same approach and concepts in another language for which Rx is available, in case you need to.
If you want to play with RxSwift, the first step is creating an Xcode project and adding the SwiftRx dependency. If you use the Swift Package Manager, just make sure your Package.swift file contains the following information:
let package = Package(
...
dependencies: [
.package(url: "https://github.com/ReactiveX/RxSwift.git", "4.0.0" ..< "5.0.0")
],
targets: [
.target(name: "TestTarget", dependencies: ["RxSwift", "RxCocoa"])
]
)
If you use CocoaPods, add the following dependencies to your podfile:
pod 'RxSwift', '~> 4.0'
pod 'RxCocoa', '~> 4.0'
Then, run this command:
pod install
Finally, if you use Carthage, add this to Cartfile:
github "ReactiveX/RxSwift" ~> 4.0
Then, run this command to finish:
carthage update