-
-
Save basilche/035e8fc76a19cb74d11b8a286ec2e12a to your computer and use it in GitHub Desktop.
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
@objc dynamic var titleKVO: String = "" | |
var titleObserver: Observable<String> { | |
return rx.observe(String.self, "titleKVO", options: .new) //using an Rx wrapper for KVO we can monitor new values of | |
} | |
let disposeBag = DisposeBag() | |
titleObserver | |
.subscribe(onNext: { title in | |
titleLabel.text = title | |
}) | |
.disposed(by: disposeBag) | |
.disposed(by: disposeBag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment