Last active
September 28, 2016 07:10
-
-
Save ibrahimkteish/369ce8d2aa58ea99dc6af594f7943ba6 to your computer and use it in GitHub Desktop.
RxSwift Variable type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do { | |
let disposeBag = DisposeBag() | |
let variable = Variable("A") | |
variable.value = "B" | |
variable.asObservable() | |
.subscribe { print($0) } | |
.addDisposableTo(disposeBag) | |
variable.value = "C" | |
variable.asObservable() | |
.subscribe { print("Second subscription:", $0) } | |
.addDisposableTo(disposeBag) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment