Merge pull request #238 from TouchInstinct/fix/pagination_wrapper_multy_requests

Fix load more request repetion in PaginationWrapper
This commit is contained in:
Loupehope 2020-08-24 20:44:27 +03:00 committed by GitHub
commit 46be8249d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 13 deletions

View File

@ -1,5 +1,8 @@
# Changelog
### 0.9.40
- **Fix**: Load more request repetion in `PaginationWrapper`.
### 0.9.39
- **Add**: `Animatable` protocol to TIUIKitCore.
- **Add**: `ActivityIndicator` protocol to TIUIKitCore.

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "LeadKit"
s.version = "0.9.39"
s.version = "0.9.40"
s.summary = "iOS framework with a bunch of tools for rapid development"
s.homepage = "https://github.com/TouchInstinct/LeadKit"
s.license = "Apache License, Version 2.0"

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