Replace rx bindings with target

This commit is contained in:
Vlad 2020-08-24 19:00:58 +03:00
parent 6a8f050e0c
commit 61e796f278
1 changed files with 5 additions and 12 deletions

View File

@ -202,12 +202,7 @@ final public class PaginationWrapper<Cursor: ResettableRxDataSourceCursor, Deleg
}
retryView.frame = CGRect(x: 0, y: 0, width: wrappedView.scrollView.bounds.width, height: retryViewHeight)
retryView.button.rx
.controlEvent(.touchUpInside)
.asObservable()
.bind(to: retryEvent)
.disposed(by: disposeBag)
retryView.button.addTarget(self, action: #selector(retryEvent), for: .touchUpInside)
uiDelegate?.footerRetryViewWillAppear()
@ -228,6 +223,10 @@ final public class PaginationWrapper<Cursor: ResettableRxDataSourceCursor, Deleg
}
}
@objc private func retryEvent() {
paginationViewModel.loadMore()
}
private func onEmptyState() {
defer {
wrappedView.scrollView.support.refreshControl?.endRefreshing()
@ -387,12 +386,6 @@ private extension PaginationWrapper {
}
}
var retryEvent: Binder<Void> {
return Binder(self) { base, _ in
base.paginationViewModel.loadMore()
}
}
var scrollOffsetChanged: Binder<CGPoint> {
return Binder(self) { base, value in
base.currentPlaceholderViewTopConstraint?.constant = -value.y