From 50736acff5836bcfba321150f13d7f7537f544db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=B8=86?= Date: Mon, 10 Jun 2019 16:54:37 +0800 Subject: [PATCH 1/3] fix noMoreData not show in the first page close #73, close #161 --- Sources/ESPullToRefresh.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/ESPullToRefresh.swift b/Sources/ESPullToRefresh.swift index 380fb1b..43eebad 100644 --- a/Sources/ESPullToRefresh.swift +++ b/Sources/ESPullToRefresh.swift @@ -403,7 +403,7 @@ open class ESRefreshFooterView: ESRefreshComponent { super.offsetChangeAction(object: object, change: change) - guard isRefreshing == false && isAutoRefreshing == false && noMoreData == false && isHidden == false else { + guard isRefreshing == false && isAutoRefreshing == false && isHidden == false else { // 正在loading more或者内容为空时不相应变化 return } @@ -415,6 +415,12 @@ open class ESRefreshFooterView: ESRefreshComponent { self.alpha = 1.0 } + if noMoreData == true { + // noMoreData 判断移到 scrollView alpha 之后 + // 避免因 alpha = 0.0 在 PullToRefresh 下调用 noticeNoMoreData 不显示 + return + } + if scrollView.contentSize.height + scrollView.contentInset.top > scrollView.bounds.size.height { // 内容超过一个屏幕 计算公式,判断是不是在拖在到了底部 if scrollView.contentSize.height - scrollView.contentOffset.y + scrollView.contentInset.bottom <= scrollView.bounds.size.height { From 6c8d704e184b655ac6f7f3cbfa93ba553a078aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=B8=86?= Date: Mon, 10 Jun 2019 16:57:01 +0800 Subject: [PATCH 2/3] update version 3.0 --- ESPullToRefreshExample/ESPullToRefreshExample/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist b/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist index 1ff9766..7f993a0 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist +++ b/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.9 + 3.0 CFBundleSignature ???? CFBundleVersion From 722fc9357cacaefc9981adfbf64381cec2aff3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=B8=86?= Date: Mon, 10 Jun 2019 16:57:01 +0800 Subject: [PATCH 3/3] update version 3.0 --- ESPullToRefresh.podspec | 2 +- ESPullToRefreshExample/ESPullToRefreshExample/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ESPullToRefresh.podspec b/ESPullToRefresh.podspec index b465b8a..608f56d 100755 --- a/ESPullToRefresh.podspec +++ b/ESPullToRefresh.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'ESPullToRefresh' - s.version = '2.9' + s.version = '3.0' s.summary = 'An easy way to use pull-to-refresh and loading-more' s.description = 'An easiest way to give pull-to-refresh and loading-more to any UIScrollView. Using swift!' s.homepage = 'https://github.com/eggswift/pull-to-refresh' diff --git a/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist b/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist index 1ff9766..7f993a0 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist +++ b/ESPullToRefreshExample/ESPullToRefreshExample/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.9 + 3.0 CFBundleSignature ???? CFBundleVersion