Fix small-loading time bug. #32

Open
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+12 −1
Split
@@ -119,14 +119,21 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL
}
+-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
+ if (!_reloading) {
+ [_refreshHeaderView egoRefreshScrollViewDataSourceDidFinishedLoading:self.tableView];
+ }
+}
+
#pragma mark -
#pragma mark EGORefreshTableHeaderDelegate Methods
- (void)egoRefreshTableHeaderDidTriggerRefresh:(EGORefreshTableHeaderView*)view{
[self reloadTableViewDataSource];
- [self performSelector:@selector(doneLoadingTableViewData) withObject:nil afterDelay:3.0];
+ [self doneLoadingTableViewData];
+ //[self performSelector:@selector(doneLoadingTableViewData) withObject:nil afterDelay:3.0];
}
@@ -225,6 +225,8 @@ - (void)egoRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2];
scrollView.contentInset = UIEdgeInsetsMake(60.0f, 0.0f, 0.0f, 0.0f);
+ [UIView setAnimationDelegate:_delegate];
+ [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:)];
[UIView commitAnimations];
}
@@ -228,6 +228,8 @@ - (void)egoRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2];
scrollView.contentInset = UIEdgeInsetsMake(60.0f, 0.0f, 0.0f, 0.0f);
+ [UIView setAnimationDelegate:_delegate];
+ [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:)];
[UIView commitAnimations];
}