Search code examples
swiftrx-swiftrx-cocoa

RxSwift - make one UI element hidden/not hidden according to other element


Im using RxSwift and RxCocoa in my project.

I have some UITextField named "lastNameTF", and there is a UILabel name "lastNameTitle".

I wanna know if there is any way to set the isHidden value of lastNameTitle always be equal to isHidden value of lastNameTF using RxSwift.


Solution

  • I believe you can use KVO as described here - https://github.com/ReactiveX/RxSwift/blob/master/Documentation/GettingStarted.md#kvo