I'm trying to apply some logic to a component when a UITableView
is scrolled, but I can't map the contentOffset
property to return the y
's value.
I'm testing like this but nothing happens:
table.rx.contentOffset.map {debugPrint($0)}
How can I do that?
Map on its own will do nothing. You need to subscribe to the stream:
table.rx.contentOffset.subscribe {
print("offset now \($0.element)")
}.disposed(by: disposeBag)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With