RxSwift

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.

It may be interesting to know that Rx.NET came into existence thanks to the work of Erik Meijer and others at Microsoft, which also led to the creation of LINQ, a popular query language for .NET, and to the introduction of async/await primitives to handle asynchronous calls on all .NET languages.

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
As you can see, we have also included RxCocoa as a dependency. RxCocoa is a framework that extends Cocoa to make it ready to be used with RxSwift. For example, RxCocoa will make many properties of your Cocoa objects observable without requiring you to add a single line of code. So if you have a UI object whose position changes depending on some user action, you can observe its center property and react to its evolution.