Merge pull request #85 from TouchInstinct/fix/paginationWrapper
Clear tableview if placeholder is shown
This commit is contained in:
commit
410d08ad7e
|
|
@ -0,0 +1,5 @@
|
|||
# Changelog
|
||||
|
||||
## 0.5.6
|
||||
|
||||
- [Fix] Clear tableview if placeholder is shown
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
Pod::Spec.new do |s|
|
||||
s.name = "LeadKit"
|
||||
s.version = "0.5.5"
|
||||
s.version = "0.5.6"
|
||||
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"
|
||||
|
|
|
|||
|
|
@ -91,6 +91,8 @@ public protocol PaginationTableViewWrapperDelegate: class {
|
|||
/// - Returns: Preferred height of "retry load more" button.
|
||||
func retryLoadMoreButtonHeight(forPaginationWrapper wrapper: PaginationTableViewWrapper<Cursor, Self>) -> CGFloat
|
||||
|
||||
// Delegate method, used to clear tableView if placeholder is shown.
|
||||
func clearTableView()
|
||||
}
|
||||
|
||||
/// Class that connects PaginationViewModel with UITableView. It handles all non-visual and visual states.
|
||||
|
|
@ -261,10 +263,6 @@ where Delegate.Cursor == Cursor {
|
|||
}
|
||||
|
||||
private func replacePlaceholderViewIfNeeded(with placeholderView: UIView) {
|
||||
// don't update placeholder view if previous placeholder is the same one
|
||||
if currentPlaceholderView === placeholderView {
|
||||
return
|
||||
}
|
||||
tableView.isUserInteractionEnabled = true
|
||||
removeCurrentPlaceholderView()
|
||||
|
||||
|
|
@ -345,8 +343,10 @@ where Delegate.Cursor == Cursor {
|
|||
case .results(let newItems, let cursor, let after):
|
||||
self?.onResultsState(newItems: newItems, inCursor: cursor, afterState: after)
|
||||
case .error(let error, let after):
|
||||
self?.delegate?.clearTableView()
|
||||
self?.onErrorState(error: error, afterState: after)
|
||||
case .empty:
|
||||
self?.delegate?.clearTableView()
|
||||
self?.onEmptyState()
|
||||
case .exhausted:
|
||||
self?.onExhaustedState()
|
||||
|
|
|
|||
Loading…
Reference in New Issue