From 52165cc2cec37725d352333c5c470ece42595334 Mon Sep 17 00:00:00 2001 From: Ivan Zinovyev Date: Wed, 13 Sep 2017 16:43:33 +0300 Subject: [PATCH 1/4] Clear tableview if placeholder is shown --- Sources/Classes/Pagination/PaginationTableViewWrapper.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Classes/Pagination/PaginationTableViewWrapper.swift b/Sources/Classes/Pagination/PaginationTableViewWrapper.swift index 81f04a0a..de090c41 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. @@ -345,8 +347,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() From ef22ddb084783ff4e25163d9a0d62ef5b8cf5119 Mon Sep 17 00:00:00 2001 From: Ivan Zinovyev Date: Wed, 13 Sep 2017 17:27:18 +0300 Subject: [PATCH 2/4] Remove placeholders comparison. This was cause why placeholders is not shown sometimes --- Sources/Classes/Pagination/PaginationTableViewWrapper.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sources/Classes/Pagination/PaginationTableViewWrapper.swift b/Sources/Classes/Pagination/PaginationTableViewWrapper.swift index de090c41..c53cc2f5 100644 --- a/Sources/Classes/Pagination/PaginationTableViewWrapper.swift +++ b/Sources/Classes/Pagination/PaginationTableViewWrapper.swift @@ -263,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() From 2d70472ae6f8954a894b796ab4793e5a35d1fe0c Mon Sep 17 00:00:00 2001 From: Ivan Zinovyev Date: Thu, 14 Sep 2017 17:55:27 +0300 Subject: [PATCH 3/4] Update version --- LeadKit.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From 2b45e4a936df84774489977ef05463fedc6e6af6 Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 14 Sep 2017 18:10:09 +0300 Subject: [PATCH 4/4] Add changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 CHANGELOG.md 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