Web view pull down to refresh EGORefreshTableHeaderView

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
Xcode4app example: Click to open the link

Here attention:

  //The initialization of refreshView, added to the WebView scrollView view
    if (_refreshHeaderView == nil) {
        _refreshHeaderView = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0, 0-carWebView.scrollView.bounds.size.height, carWebView.scrollView.frame.size.width, carWebView.scrollView.bounds.size.height)];
        _refreshHeaderView.delegate = self;
        [carWebView.scrollView addSubview:_refreshHeaderView];//There must be added to the scrollView, otherwise it will not show
    }
    [_refreshHeaderView refreshLastUpdatedDate];



EGORefreshTableHeaderView.h

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

typedef enum{
	EGOOPullRefreshPulling = 0,
	EGOOPullRefreshNormal,
	EGOOPullRefreshLoading,	
} EGOPullRefreshState;

@protocol EGORefreshTableHeaderDelegate;
@interface EGORefreshTableHeaderView : UIView {
	
	id _delegate;
	EGOPullRefreshState _state;

	UILabel *_lastUpdatedLabel;//Display the last update time label
	UILabel *_statusLabel;//Displays the status of label
	CALayer *_arrowImage;//The arrow
	UIActivityIndicatorView *_activityView;//Waiting around
	

}

@property(nonatomic,assign) id <EGORefreshTableHeaderDelegate> delegate;

- (void)refreshLastUpdatedDate;//Refresh the last update time

- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView;//Scroll view rolling to refresh the display interface
- (void)egoRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView;//Scroll view drag
- (void)egoRefreshScrollViewDidEndDraggingWithRefreshButton:(UIScrollView *)scrollView;         //To refresh the call button
- (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView;//Refresh the ScrollViewDataSource

@end


//Protocol EGORefreshTableHeaderDelegate
@protocol EGORefreshTableHeaderDelegate
- (void)egoRefreshTableHeaderDidTriggerRefresh:(EGORefreshTableHeaderView*)view;// Data is returned to the trigger event, refresh
- (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(EGORefreshTableHeaderView*)view;//To determine whether the refresh, refresh identification return
@optional
- (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(EGORefreshTableHeaderView*)view;//The self refresh header data source last updated date: 
@end

To understand the flow of execution, convenient modified their desired effect
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Gavin at December 01, 2013 - 8:45 AM