diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..6da311bc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.5.6 + +- [Fix] Clear tableview if placeholder is shown \ No newline at end of file diff --git a/LeadKit.podspec b/LeadKit.podspec index 389b855d..b2794995 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -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" diff --git a/Sources/Classes/Pagination/PaginationTableViewWrapper.swift b/Sources/Classes/Pagination/PaginationTableViewWrapper.swift index 81f04a0a..c53cc2f5 100644 --- a/Sources/Classes/Pagination/PaginationTableViewWrapper.swift +++ b/Sources/Classes/Pagination/PaginationTableViewWrapper.swift @@ -91,6 +91,8 @@ public protocol PaginationTableViewWrapperDelegate: class { /// - Returns: Preferred height of "retry load more" button. func retryLoadMoreButtonHeight(forPaginationWrapper wrapper: PaginationTableViewWrapper) -> 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()