Skip to content

Commit 654c08f

Browse files
committed
Merge pull request CoderMJLee#497 from xiaozi4624/master
修复当前正在刷新中时调用beginRefreshing方法使得header insert回置失败
2 parents a21893d + d2670fc commit 654c08f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

MJRefresh/Base/MJRefreshComponent.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,12 @@ - (void)beginRefreshing
144144
if (self.window) {
145145
self.state = MJRefreshStateRefreshing;
146146
} else {
147-
self.state = MJRefreshStateWillRefresh;
148-
// 刷新(预防从另一个控制器回到这个控制器的情况,回来要重新刷新一下)
149-
[self setNeedsDisplay];
147+
// 预发当前正在刷新中时调用本方法使得header insert回置失败
148+
if (self.state != MJRefreshStateRefreshing) {
149+
self.state = MJRefreshStateWillRefresh;
150+
// 刷新(预防从另一个控制器回到这个控制器的情况,回来要重新刷新一下)
151+
[self setNeedsDisplay];
152+
}
150153
}
151154
}
152155

0 commit comments

Comments
 (0)