Join Jon Bott for an in-depth discussion in this video What is RxSwift?, part of RxSwift: Design Patterns for iOS Developers.
- [Instructor] Before we dive into how to use RxSwift, let's talk about what it is. RxSwift can simply be thought of as a library that gives us an easy-to-use observer pattern. This means that we have a process to be notified of when data changes, when a task completes, or if there are any errors that happen along the way. With Objective-C we have the key value observer pattern to work with. But it has issues. It's complex. It's stringly typed, and there's not very clear patterns for working in an architected application.
It's also not very swifty. RxSwift can simplify a lot of this and provide a common pattern to respond to user events, model data changes, and map those values to new results. It also allows us to chain complex logic through the different architectural layers while delaying execution and easily working in a threaded environment. This just scratches the surface. But let's take a step back and look at the ReactiveX family as a whole.
We're here on the ReactiveX Languages page. And like I said, RxSwift is part of the family. We have Java. We have C#. We have Kotlin. So, once you learn these patterns in iOS, if you're developing in Android you can apply these same principles. If you're working on a web service, you can apply these same principles across to there.
- RxSwift syntax
- Creating simple observables
- Architecting the model layer
- Using Core Data
- Grouping tasks
- Changing UI
- Threading in the model and UI