From 84660b912ae6edd00972e84a40d5fe8321dea5d0 Mon Sep 17 00:00:00 2001 From: Frank <472730949@qq.com> Date: Tue, 30 Nov 2021 11:15:57 +0800 Subject: [PATCH] Removed duplicated async method on main queue. --- MJRefresh/Base/MJRefreshHeader.m | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/MJRefresh/Base/MJRefreshHeader.m b/MJRefresh/Base/MJRefreshHeader.m index b70a0a46..9baf17a0 100644 --- a/MJRefresh/Base/MJRefreshHeader.m +++ b/MJRefresh/Base/MJRefreshHeader.m @@ -203,21 +203,19 @@ - (void)headerEndingAction { - (void)headerRefreshingAction { // 默认使用 UIViewAnimation 动画 if (!self.isCollectionViewAnimationBug) { - MJRefreshDispatchAsyncOnMainQueue({ - [UIView animateWithDuration:self.fastAnimationDuration animations:^{ - if (self.scrollView.panGestureRecognizer.state != UIGestureRecognizerStateCancelled) { - CGFloat top = self.scrollViewOriginalInset.top + self.mj_h; - // 增加滚动区域top - self.scrollView.mj_insetT = top; - // 设置滚动位置 - CGPoint offset = self.scrollView.contentOffset; - offset.y = -top; - [self.scrollView setContentOffset:offset animated:NO]; - } - } completion:^(BOOL finished) { - [self executeRefreshingCallback]; - }]; - }) + [UIView animateWithDuration:self.fastAnimationDuration animations:^{ + if (self.scrollView.panGestureRecognizer.state != UIGestureRecognizerStateCancelled) { + CGFloat top = self.scrollViewOriginalInset.top + self.mj_h; + // 增加滚动区域top + self.scrollView.mj_insetT = top; + // 设置滚动位置 + CGPoint offset = self.scrollView.contentOffset; + offset.y = -top; + [self.scrollView setContentOffset:offset animated:NO]; + } + } completion:^(BOOL finished) { + [self executeRefreshingCallback]; + }]; return; }