Can I observe read only variable by RxSwift ?
I'm trying observe variable from extendal library (iCarousel)
This is my code:
carouselView.rx.observe(Bool.self, "isScrolling")
.map { $0 != nil }
.subscribe(onNext: { (isScrolling) in
print("isScrolling", isScrolling)
}).addDisposableTo(disposeBag)
Console print this but only one time:
isScrolling, false
I see it now. This is equal to
so you are not return weather or not it is nil but the boolean value of it being nil. what you want to use is filter
like