diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac8f968 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc + +# Logs and databases # +###################### +*.log + +# OS generated files # +###################### +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db diff --git a/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.h b/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.h index 66c6406..dff6e40 100755 --- a/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.h +++ b/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.h @@ -28,11 +28,11 @@ #import "EGORefreshTableHeaderView.h" @interface RootViewController : UITableViewController { - + EGORefreshTableHeaderView *_refreshHeaderView; - + // Reloading var should really be your tableviews datasource - // Putting it here for demo purposes + // Putting it here for demo purposes BOOL _reloading; } diff --git a/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.m b/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.m index 7153dc3..6b35230 100755 --- a/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.m +++ b/Demo/TableViewPull/Classes/Controller/RootViewController/RootViewController.m @@ -30,21 +30,21 @@ @implementation RootViewController - (void)viewDidLoad { [super viewDidLoad]; - + if (_refreshHeaderView == nil) { - + EGORefreshTableHeaderView *view = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f - self.tableView.bounds.size.height, self.view.frame.size.width, self.tableView.bounds.size.height)]; view.delegate = self; [self.tableView addSubview:view]; _refreshHeaderView = view; [view release]; - + } - + // update the last update date [_refreshHeaderView refreshLastUpdatedDate]; - + } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -64,23 +64,23 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - + static NSString *CellIdentifier = @"Cell"; - + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } - + // Configure the cell. return cell; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{ - + return [NSString stringWithFormat:@"Section %i", section]; - + } @@ -88,35 +88,35 @@ - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInte #pragma mark Data Source Loading / Reloading Methods - (void)reloadTableViewDataSource{ - + // should be calling your tableviews data source model to reload // put here just for demo _reloading = YES; - + } - (void)doneLoadingTableViewData{ - + // model should call this when its done loading _reloading = NO; [_refreshHeaderView egoRefreshScrollViewDataSourceDidFinishedLoading:self.tableView]; - + } #pragma mark - #pragma mark UIScrollViewDelegate Methods -- (void)scrollViewDidScroll:(UIScrollView *)scrollView{ - +- (void)scrollViewDidScroll:(UIScrollView *)scrollView{ + [_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView]; - + } - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{ - + [_refreshHeaderView egoRefreshScrollViewDidEndDragging:scrollView]; - + } @@ -124,22 +124,22 @@ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL #pragma mark EGORefreshTableHeaderDelegate Methods - (void)egoRefreshTableHeaderDidTriggerRefresh:(EGORefreshTableHeaderView*)view{ - + [self reloadTableViewDataSource]; [self performSelector:@selector(doneLoadingTableViewData) withObject:nil afterDelay:3.0]; - + } - (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(EGORefreshTableHeaderView*)view{ - + return _reloading; // should return if data source model is reloading - + } - (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(EGORefreshTableHeaderView*)view{ - + return [NSDate date]; // should return date data source was last changed - + } @@ -155,7 +155,7 @@ - (void)viewDidUnload { } - (void)dealloc { - + _refreshHeaderView = nil; [super dealloc]; } diff --git a/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.h b/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.h index 94aebfc..2a623b1 100755 --- a/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.h +++ b/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.h @@ -25,7 +25,7 @@ // @interface TableViewPullAppDelegate : NSObject { - + UIWindow *window; UINavigationController *navigationController; } diff --git a/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.m b/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.m index c0acdd3..2724943 100755 --- a/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.m +++ b/Demo/TableViewPull/Classes/Delegate/TableViewPullAppDelegate.m @@ -37,10 +37,10 @@ @implementation TableViewPullAppDelegate #pragma mark - #pragma mark Application lifecycle -- (void)applicationDidFinishLaunching:(UIApplication *)application { - - // Override point for customization after app launch - +- (void)applicationDidFinishLaunching:(UIApplication *)application { + + // Override point for customization after app launch + [window addSubview:[navigationController view]]; [window makeKeyAndVisible]; } diff --git a/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.h b/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.h index 82077db..3920e30 100755 --- a/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.h +++ b/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.h @@ -30,12 +30,12 @@ typedef enum{ EGOOPullRefreshPulling = 0, EGOOPullRefreshNormal, - EGOOPullRefreshLoading, + EGOOPullRefreshLoading, } EGOPullRefreshState; @protocol EGORefreshTableHeaderDelegate; @interface EGORefreshTableHeaderView : UIView { - + id _delegate; EGOPullRefreshState _state; @@ -43,7 +43,7 @@ typedef enum{ UILabel *_statusLabel; CALayer *_arrowImage; UIActivityIndicatorView *_activityView; - + } diff --git a/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.m b/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.m index 0def219..b2fe11c 100755 --- a/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.m +++ b/Demo/TableViewPull/Classes/View/RefreshTableHeaderView/EGORefreshTableHeaderView.m @@ -42,7 +42,7 @@ @implementation EGORefreshTableHeaderView - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - + self.autoresizingMask = UIViewAutoresizingFlexibleWidth; self.backgroundColor = [UIColor colorWithRed:226.0/255.0 green:231.0/255.0 blue:237.0/255.0 alpha:1.0]; @@ -57,7 +57,7 @@ - (id)initWithFrame:(CGRect)frame { [self addSubview:label]; _lastUpdatedLabel=label; [label release]; - + label = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, frame.size.height - 48.0f, self.frame.size.width, 20.0f)]; label.autoresizingMask = UIViewAutoresizingFlexibleWidth; label.font = [UIFont boldSystemFontOfSize:13.0f]; @@ -69,34 +69,34 @@ - (id)initWithFrame:(CGRect)frame { [self addSubview:label]; _statusLabel=label; [label release]; - + CALayer *layer = [CALayer layer]; layer.frame = CGRectMake(25.0f, frame.size.height - 65.0f, 30.0f, 55.0f); layer.contentsGravity = kCAGravityResizeAspect; layer.contents = (id)[UIImage imageNamed:@"blueArrow.png"].CGImage; - + #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { layer.contentsScale = [[UIScreen mainScreen] scale]; } #endif - + [[self layer] addSublayer:layer]; _arrowImage=layer; - + UIActivityIndicatorView *view = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; view.frame = CGRectMake(25.0f, frame.size.height - 38.0f, 20.0f, 20.0f); [self addSubview:view]; _activityView = view; [view release]; - - + + [self setState:EGOOPullRefreshNormal]; - + } - + return self; - + } @@ -104,11 +104,11 @@ - (id)initWithFrame:(CGRect)frame { #pragma mark Setters - (void)refreshLastUpdatedDate { - + if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDataSourceLastUpdated:)]) { - + NSDate *date = [_delegate egoRefreshTableHeaderDataSourceLastUpdated:self]; - + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setAMSymbol:@"AM"]; [formatter setPMSymbol:@"PM"]; @@ -117,61 +117,61 @@ - (void)refreshLastUpdatedDate { [[NSUserDefaults standardUserDefaults] setObject:_lastUpdatedLabel.text forKey:@"EGORefreshTableView_LastRefresh"]; [[NSUserDefaults standardUserDefaults] synchronize]; [formatter release]; - + } else { - + _lastUpdatedLabel.text = nil; - + } } - (void)setState:(EGOPullRefreshState)aState{ - + switch (aState) { case EGOOPullRefreshPulling: - + _statusLabel.text = NSLocalizedString(@"Release to refresh...", @"Release to refresh status"); [CATransaction begin]; [CATransaction setAnimationDuration:FLIP_ANIMATION_DURATION]; _arrowImage.transform = CATransform3DMakeRotation((M_PI / 180.0) * 180.0f, 0.0f, 0.0f, 1.0f); [CATransaction commit]; - + break; case EGOOPullRefreshNormal: - + if (_state == EGOOPullRefreshPulling) { [CATransaction begin]; [CATransaction setAnimationDuration:FLIP_ANIMATION_DURATION]; _arrowImage.transform = CATransform3DIdentity; [CATransaction commit]; } - + _statusLabel.text = NSLocalizedString(@"Pull down to refresh...", @"Pull down to refresh status"); [_activityView stopAnimating]; [CATransaction begin]; - [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; _arrowImage.hidden = NO; _arrowImage.transform = CATransform3DIdentity; [CATransaction commit]; - + [self refreshLastUpdatedDate]; - + break; case EGOOPullRefreshLoading: - + _statusLabel.text = NSLocalizedString(@"Loading...", @"Loading Status"); [_activityView startAnimating]; [CATransaction begin]; - [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; _arrowImage.hidden = YES; [CATransaction commit]; - + break; default: break; } - + _state = aState; } @@ -179,65 +179,65 @@ - (void)setState:(EGOPullRefreshState)aState{ #pragma mark - #pragma mark ScrollView Methods -- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView { - +- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView { + if (_state == EGOOPullRefreshLoading) { - + CGFloat offset = MAX(scrollView.contentOffset.y * -1, 0); offset = MIN(offset, 60); scrollView.contentInset = UIEdgeInsetsMake(offset, 0.0f, 0.0f, 0.0f); - + } else if (scrollView.isDragging) { - + BOOL _loading = NO; if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDataSourceIsLoading:)]) { _loading = [_delegate egoRefreshTableHeaderDataSourceIsLoading:self]; } - + if (_state == EGOOPullRefreshPulling && scrollView.contentOffset.y > -65.0f && scrollView.contentOffset.y < 0.0f && !_loading) { [self setState:EGOOPullRefreshNormal]; } else if (_state == EGOOPullRefreshNormal && scrollView.contentOffset.y < -65.0f && !_loading) { [self setState:EGOOPullRefreshPulling]; } - + if (scrollView.contentInset.top != 0) { scrollView.contentInset = UIEdgeInsetsZero; } - + } - + } - (void)egoRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView { - + BOOL _loading = NO; if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDataSourceIsLoading:)]) { _loading = [_delegate egoRefreshTableHeaderDataSourceIsLoading:self]; } - + if (scrollView.contentOffset.y <= - 65.0f && !_loading) { - + if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDidTriggerRefresh:)]) { [_delegate egoRefreshTableHeaderDidTriggerRefresh:self]; } - + [self setState:EGOOPullRefreshLoading]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.2]; scrollView.contentInset = UIEdgeInsetsMake(60.0f, 0.0f, 0.0f, 0.0f); [UIView commitAnimations]; - + } - + } -- (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView { - +- (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView { + [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:.3]; [scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)]; [UIView commitAnimations]; - + [self setState:EGOOPullRefreshNormal]; } @@ -247,7 +247,7 @@ - (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollV #pragma mark Dealloc - (void)dealloc { - + _delegate=nil; _activityView = nil; _statusLabel = nil; diff --git a/Demo/TableViewPull/main.m b/Demo/TableViewPull/main.m index 8916dd2..fe23610 100755 --- a/Demo/TableViewPull/main.m +++ b/Demo/TableViewPull/main.m @@ -9,7 +9,7 @@ #import int main(int argc, char *argv[]) { - + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); [pool release]; diff --git a/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.h b/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.h index 0ec72f0..a8946c9 100755 --- a/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.h +++ b/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.h @@ -30,12 +30,12 @@ typedef enum{ EGOOPullRefreshPulling = 0, EGOOPullRefreshNormal, - EGOOPullRefreshLoading, + EGOOPullRefreshLoading, } EGOPullRefreshState; @protocol EGORefreshTableHeaderDelegate; @interface EGORefreshTableHeaderView : UIView { - + id _delegate; EGOPullRefreshState _state; @@ -43,7 +43,7 @@ typedef enum{ UILabel *_statusLabel; CALayer *_arrowImage; UIActivityIndicatorView *_activityView; - + } diff --git a/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.m b/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.m index 56b345b..44ae2f0 100755 --- a/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.m +++ b/EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.m @@ -42,7 +42,7 @@ @implementation EGORefreshTableHeaderView - (id)initWithFrame:(CGRect)frame arrowImageName:(NSString *)arrow textColor:(UIColor *)textColor { if((self = [super initWithFrame:frame])) { - + self.autoresizingMask = UIViewAutoresizingFlexibleWidth; self.backgroundColor = [UIColor colorWithRed:226.0/255.0 green:231.0/255.0 blue:237.0/255.0 alpha:1.0]; @@ -57,7 +57,7 @@ - (id)initWithFrame:(CGRect)frame arrowImageName:(NSString *)arrow textColor:(UI [self addSubview:label]; _lastUpdatedLabel=label; [label release]; - + label = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, frame.size.height - 48.0f, self.frame.size.width, 20.0f)]; label.autoresizingMask = UIViewAutoresizingFlexibleWidth; label.font = [UIFont boldSystemFontOfSize:13.0f]; @@ -69,34 +69,34 @@ - (id)initWithFrame:(CGRect)frame arrowImageName:(NSString *)arrow textColor:(UI [self addSubview:label]; _statusLabel=label; [label release]; - + CALayer *layer = [CALayer layer]; layer.frame = CGRectMake(25.0f, frame.size.height - 65.0f, 30.0f, 55.0f); layer.contentsGravity = kCAGravityResizeAspect; layer.contents = (id)[UIImage imageNamed:arrow].CGImage; - + #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { layer.contentsScale = [[UIScreen mainScreen] scale]; } #endif - + [[self layer] addSublayer:layer]; _arrowImage=layer; - + UIActivityIndicatorView *view = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; view.frame = CGRectMake(25.0f, frame.size.height - 38.0f, 20.0f, 20.0f); [self addSubview:view]; _activityView = view; [view release]; - - + + [self setState:EGOOPullRefreshNormal]; - + } - + return self; - + } - (id)initWithFrame:(CGRect)frame { @@ -107,11 +107,11 @@ - (id)initWithFrame:(CGRect)frame { #pragma mark Setters - (void)refreshLastUpdatedDate { - + if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDataSourceLastUpdated:)]) { - + NSDate *date = [_delegate egoRefreshTableHeaderDataSourceLastUpdated:self]; - + [NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehaviorDefault]; NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateStyle:NSDateFormatterShortStyle]; @@ -120,61 +120,61 @@ - (void)refreshLastUpdatedDate { _lastUpdatedLabel.text = [NSString stringWithFormat:@"Last Updated: %@", [dateFormatter stringFromDate:date]]; [[NSUserDefaults standardUserDefaults] setObject:_lastUpdatedLabel.text forKey:@"EGORefreshTableView_LastRefresh"]; [[NSUserDefaults standardUserDefaults] synchronize]; - + } else { - + _lastUpdatedLabel.text = nil; - + } } - (void)setState:(EGOPullRefreshState)aState{ - + switch (aState) { case EGOOPullRefreshPulling: - + _statusLabel.text = NSLocalizedString(@"Release to refresh...", @"Release to refresh status"); [CATransaction begin]; [CATransaction setAnimationDuration:FLIP_ANIMATION_DURATION]; _arrowImage.transform = CATransform3DMakeRotation((M_PI / 180.0) * 180.0f, 0.0f, 0.0f, 1.0f); [CATransaction commit]; - + break; case EGOOPullRefreshNormal: - + if (_state == EGOOPullRefreshPulling) { [CATransaction begin]; [CATransaction setAnimationDuration:FLIP_ANIMATION_DURATION]; _arrowImage.transform = CATransform3DIdentity; [CATransaction commit]; } - + _statusLabel.text = NSLocalizedString(@"Pull down to refresh...", @"Pull down to refresh status"); [_activityView stopAnimating]; [CATransaction begin]; - [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; _arrowImage.hidden = NO; _arrowImage.transform = CATransform3DIdentity; [CATransaction commit]; - + [self refreshLastUpdatedDate]; - + break; case EGOOPullRefreshLoading: - + _statusLabel.text = NSLocalizedString(@"Loading...", @"Loading Status"); [_activityView startAnimating]; [CATransaction begin]; - [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; + [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; _arrowImage.hidden = YES; [CATransaction commit]; - + break; default: break; } - + _state = aState; } @@ -182,65 +182,65 @@ - (void)setState:(EGOPullRefreshState)aState{ #pragma mark - #pragma mark ScrollView Methods -- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView { - +- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView { + if (_state == EGOOPullRefreshLoading) { - + CGFloat offset = MAX(scrollView.contentOffset.y * -1, 0); offset = MIN(offset, 60); scrollView.contentInset = UIEdgeInsetsMake(offset, 0.0f, 0.0f, 0.0f); - + } else if (scrollView.isDragging) { - + BOOL _loading = NO; if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDataSourceIsLoading:)]) { _loading = [_delegate egoRefreshTableHeaderDataSourceIsLoading:self]; } - + if (_state == EGOOPullRefreshPulling && scrollView.contentOffset.y > -65.0f && scrollView.contentOffset.y < 0.0f && !_loading) { [self setState:EGOOPullRefreshNormal]; } else if (_state == EGOOPullRefreshNormal && scrollView.contentOffset.y < -65.0f && !_loading) { [self setState:EGOOPullRefreshPulling]; } - + if (scrollView.contentInset.top != 0) { scrollView.contentInset = UIEdgeInsetsZero; } - + } - + } - (void)egoRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView { - + BOOL _loading = NO; if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDataSourceIsLoading:)]) { _loading = [_delegate egoRefreshTableHeaderDataSourceIsLoading:self]; } - + if (scrollView.contentOffset.y <= - 65.0f && !_loading) { - + if ([_delegate respondsToSelector:@selector(egoRefreshTableHeaderDidTriggerRefresh:)]) { [_delegate egoRefreshTableHeaderDidTriggerRefresh:self]; } - + [self setState:EGOOPullRefreshLoading]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.2]; scrollView.contentInset = UIEdgeInsetsMake(60.0f, 0.0f, 0.0f, 0.0f); [UIView commitAnimations]; - + } - + } -- (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView { - +- (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView { + [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:.3]; [scrollView setContentInset:UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)]; [UIView commitAnimations]; - + [self setState:EGOOPullRefreshNormal]; } @@ -250,7 +250,7 @@ - (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollV #pragma mark Dealloc - (void)dealloc { - + _delegate=nil; _activityView = nil; _statusLabel = nil;