Skip to content

Commit be7ae77

Browse files
authored
Removed duplicated async method on main queue. (#1559)
Caused by ada9e24 and 8dd6e3a
1 parent 5cf279f commit be7ae77

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

MJRefresh/Base/MJRefreshHeader.m

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,19 @@ - (void)headerEndingAction {
203203
- (void)headerRefreshingAction {
204204
// 默认使用 UIViewAnimation 动画
205205
if (!self.isCollectionViewAnimationBug) {
206-
MJRefreshDispatchAsyncOnMainQueue({
207-
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
208-
if (self.scrollView.panGestureRecognizer.state != UIGestureRecognizerStateCancelled) {
209-
CGFloat top = self.scrollViewOriginalInset.top + self.mj_h;
210-
// 增加滚动区域top
211-
self.scrollView.mj_insetT = top;
212-
// 设置滚动位置
213-
CGPoint offset = self.scrollView.contentOffset;
214-
offset.y = -top;
215-
[self.scrollView setContentOffset:offset animated:NO];
216-
}
217-
} completion:^(BOOL finished) {
218-
[self executeRefreshingCallback];
219-
}];
220-
})
206+
[UIView animateWithDuration:self.fastAnimationDuration animations:^{
207+
if (self.scrollView.panGestureRecognizer.state != UIGestureRecognizerStateCancelled) {
208+
CGFloat top = self.scrollViewOriginalInset.top + self.mj_h;
209+
// 增加滚动区域top
210+
self.scrollView.mj_insetT = top;
211+
// 设置滚动位置
212+
CGPoint offset = self.scrollView.contentOffset;
213+
offset.y = -top;
214+
[self.scrollView setContentOffset:offset animated:NO];
215+
}
216+
} completion:^(BOOL finished) {
217+
[self executeRefreshingCallback];
218+
}];
221219
return;
222220
}
223221

0 commit comments

Comments
 (0)