ソースを参照

Removed duplicated async method on main queue. (#1559)

Caused by ada9e24 and 8dd6e3a
Frank 4 年 前
コミット
be7ae776f0
1 ファイル変更13 行追加15 行削除
  1. 13 15
      MJRefresh/Base/MJRefreshHeader.m

+ 13 - 15
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;
     }