Skip to content

Instantly share code, notes, and snippets.

@sergdort
Created December 17, 2015 16:15
Show Gist options
  • Save sergdort/898b66c978750400a09b to your computer and use it in GitHub Desktop.
Save sergdort/898b66c978750400a09b to your computer and use it in GitHub Desktop.
import RxSwift
extension UITableView {
var rxex_nextPageTriger:Observable<Void> {
return self
.rx_contentOffset
.flatMapLatest { [unowned self] (offset) -> Observable<Void> in
let shouldTriger = offset.y + self.frame.size.height + 40 > self.contentSize.height
return shouldTriger ? just() : empty()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment