Open source Third party address: Https://github.com/CoderMJLee/MJRefresh
Default Pull-down example
Call the method separately. You can also use block.
Mjrefreshnormalheader *header = [Mjrefreshnormalheader headerwithrefreshingtarget:self refreshingAction: @selector ( Headrefresh)];
Mjrefreshautonormalfooter *footer = [Mjrefreshautonormalfooter footerwithrefreshingtarget:self refreshingAction:@ Selector (Footrefresh)];
Self.tabeleView.mj_header = header;
Self.tabeleView.mj_footer = footer;
[Self.tabeleView.mj_header beginrefreshing];
A kind of pull-down and two planting
-1.1 General Chrysanthemum drop Mjrefreshnormalheader
-1.2 Add animation drop-down Mjrefreshgifheader
-2.1-click or Auto-load daisy pull-up Mjrefreshautonormalfooter
-2.2-click or auto-load animation pull-up Mjrefreshautogiffooter
-3.1 Reverse Daisy pull-up Mjrefreshbacknormalfooter
-3.2 Reverse animation on pull Mjrefreshbackgiffooter
Basic properties and methods
/** Enter Refresh Status */
-(void) beginrefreshing;
/** End Refresh Status */
-(void) endrefreshing;
/** is refreshing */
-(BOOL) isrefreshing;
/** automatically toggles transparency according to the drag ratio */
@property (Assign, nonatomic, Getter=isautomaticallychangealpha) BOOL Automaticallychangealpha;
Prompt text and time
All headers can be set prompt text, drop-down can set the refresh time
General use of 3 states: Mjrefreshstateidle,mjrefreshstatepulling,mjrefreshstaterefreshing
Hint text provides a label customization, and there are ways to set the display content in different states
Header.stateLabel.hidden = YES;
[Header settitle:@] and then pull down a bit to refresh the "Forstate:mjrefreshstateidle";
[Header settitle:@ "release that is Refresh" forstate:mjrefreshstatepulling];
[Header settitle:@ "Loading ..." forstate:mjrefreshstaterefreshing];
Update time provides a label customization
Header.lastUpdatedTimeLabel.hidden = YES;
Loading animations
All GIF headers can be set in an array of images.
General use of 3 states: Mjrefreshstateidle,mjrefreshstatepulling,mjrefreshstaterefreshing
Set up an array of pictures in different states
[Gifheader setimages:arr1 forstate:mjrefreshstateidle];//a piece is enough.
[Gifheader setimages:arr2 forstate:mjrefreshstatepulling];
[Gifheader SETIMAGES:ARR3 forstate:mjrefreshstaterefreshing];
Other
Fully customizable See demo DIY,
iOS pull-down refresh-Mjrefresh