Commit b0f79c00 authored by 汪洋's avatar 汪洋

Merge branch 'jql/refresh' into 'master'

添加不同时执行header、footer刷新

See merge request !7
parents a5165150 a5f497e3
......@@ -35,7 +35,22 @@
- (void)executeRefreshingCallback
{
[super executeRefreshingCallback];
dispatch_async(dispatch_get_main_queue(), ^{
MJRefreshHeader *header = _scrollView.mj_header;
if (header && [header isRefreshing]) {
[self endRefreshing];
} else {
if (self.refreshingBlock) {
self.refreshingBlock();
}
if ([self.refreshingTarget respondsToSelector:self.refreshingAction]) {
MJRefreshMsgSend(MJRefreshMsgTarget(self.refreshingTarget), self.refreshingAction, self);
}
if (self.beginRefreshingCompletionBlock) {
self.beginRefreshingCompletionBlock();
}
}
});
NSString *pageName = [self myViewController].pageName ?: @"";
[Phobos track:@"upload_page" attributes:@{@"page_name":pageName}];
}
......
......@@ -98,7 +98,22 @@
- (void)executeRefreshingCallback
{
[super executeRefreshingCallback];
dispatch_async(dispatch_get_main_queue(), ^{
MJRefreshFooter *footer = _scrollView.mj_footer;
if (footer && [footer isRefreshing]) {
[self endRefreshing];
} else {
if (self.refreshingBlock) {
self.refreshingBlock();
}
if ([self.refreshingTarget respondsToSelector:self.refreshingAction]) {
MJRefreshMsgSend(MJRefreshMsgTarget(self.refreshingTarget), self.refreshingAction, self);
}
if (self.beginRefreshingCompletionBlock) {
self.beginRefreshingCompletionBlock();
}
}
});
NSString *pageName = [self myViewController].pageName ?: @"";
[Phobos track:@"refresh_page" attributes:@{@"page_name":pageName}];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment