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 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 {