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
could it be because it is a User scrolling and not a programatic scrolling?
this is from iCarousel documentation.
Returns YES if the carousel is currently being scrolled programatically.
if that is the case you might want to use these in a combination
Returns YES if user has started scrolling the carousel and has not yet released it.
Returns YES if the user isn't dragging the carousel any more, but it is still moving.