I suggest that you read the documentation for RxSwift Traits such as Driver.
Why use Traits?
Swift has a powerful type system that can be used to improve the correctness and stability of applications and make using Rx a more intuitive and straightforward experience.
By using units that follow constraints, we can rely on the compiler to show us errors if we're trying to do something we're not supposed to do (e.g. perform UI code on a Driver's drive
method).
It is the same concept as to why we use data structures like Stacks and Queues depending on what is appropriate for the context or problem.
Driver
You can read more in detail what the Driver is all about from the documentation. In summary, it simply allows you to rely on these properties:
- Can't error out
- Observe on main scheduler
- Sharing side effects
which is common when dealing with your user interface.
Why it's named Driver
Its intended use case was to model sequences that drive your application.
Community
Come join the RxSwift community in Slack if you are interested to meet like-minded and new and old RxSwift-ers. :)
- Quotations are lifted from the documentation of RxSwift.