In the future, Variable will be deprecated in RxSwift 4. Instead, Relay classes were first implemented in RxCocoa 4, and an alternate proposed to Variable is BehaviorRelay.
Assigning the value of a Variable is an imperative programming-style command. Its convenient but not belongs in Reactive’s declarative programming environment.
What are their pros and cons?
I recommend you read this post (or maybe all thread) to find out some user-friendly explanation about Variable
and Driver
.