diff --git a/MJRefresh.podspec b/MJRefresh.podspec index c1fee274..3d98ff73 100644 --- a/MJRefresh.podspec +++ b/MJRefresh.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MJRefresh" - s.version = "2.4.2" + s.version = "2.4.3" s.summary = "The easiest way to use pull-to-refresh" s.homepage = "https://github.com/CoderMJLee/MJRefresh" s.license = "MIT" diff --git a/MJRefresh/Base/MJRefreshAutoFooter.h b/MJRefresh/Base/MJRefreshAutoFooter.h index ac988748..ed44b968 100644 --- a/MJRefresh/Base/MJRefreshAutoFooter.h +++ b/MJRefresh/Base/MJRefreshAutoFooter.h @@ -14,7 +14,4 @@ /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh; - -/** 防止加载数据速度过快时,连续刷新N次 */ -@property (assign, nonatomic, getter=isPreventContinuousRefreshing) BOOL preventContinuousRefreshing; @end diff --git a/MJRefresh/Base/MJRefreshAutoFooter.m b/MJRefresh/Base/MJRefreshAutoFooter.m index 9d7d84ed..2f6d36f8 100644 --- a/MJRefresh/Base/MJRefreshAutoFooter.m +++ b/MJRefresh/Base/MJRefreshAutoFooter.m @@ -9,7 +9,6 @@ #import "MJRefreshAutoFooter.h" @interface MJRefreshAutoFooter() -@property (strong, nonatomic) UIPanGestureRecognizer *pan; @end @implementation MJRefreshAutoFooter @@ -65,13 +64,6 @@ - (void)scrollViewContentOffsetDidChange:(NSDictionary *)change // 当底部刷新控件完全出现时,才刷新 [self beginRefreshing]; - - // 如果正在减速,并且希望阻止连续刷新 - if (self.scrollView.isDecelerating && self.preventContinuousRefreshing) { - CGPoint offset = self.scrollView.contentOffset; - offset.y = _scrollView.mj_contentH - _scrollView.mj_h + self.mj_h + _scrollView.mj_insetB - self.mj_h; - [self.scrollView setContentOffset:offset animated:YES]; - } } } } @@ -100,7 +92,9 @@ - (void)setState:(MJRefreshState)state MJRefreshCheckState if (state == MJRefreshStateRefreshing) { - [self executeRefreshingCallback]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self executeRefreshingCallback]; + }); } } diff --git a/MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate b/MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate index 6d7aab8c..20e5071c 100644 Binary files a/MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate and b/MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/README.md b/README.md index b5a25e3b..b88f62f5 100644 --- a/README.md +++ b/README.md @@ -140,9 +140,6 @@ UIView+MJExtension.h UIView+MJExtension.m /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh; - -/** 防止加载数据速度过快时,连续刷新N次 */ -@property (assign, nonatomic, getter=isPreventContinuousRefreshing) BOOL preventContinuousRefreshing; @end ```