IOS Development Pull-down refresh and pull-up load more introduction 1, common pull-down refresh implementation mode
(1) Uirefreshcontrol
(2) Egottableviewrefresh
(3) Ah3dpullrefresh
(4) Mjrefresh
(5) Self-realization
2, Ah3dpullrefresh implementation of the pull-down refresh and pull-up download steps
- Add uiscrollview+ah3dpullrefresh.h and uiscrollview+ah3dpullrefresh.m two files, so it is based on the Uiscrollview method.
- In buildphases compile sources find the AH3DPULLREFRESH.H, and click on it, found will pop up a dialog box, enter the following letters in the box-fno-objc-arc
- Add #improt to the header of the referenced file
- This method is a refresh method that references Setpulltorefreshhandler in the method. Another setpulltoloadmorehandler is the load method. The execution functions for loading and flushing are written in the block function body. You need to join refreshfinished or loadmorefinished in the body of the function you are executing after the data is loaded.
3, using the Cocoachaina website Refresh control, a section called Uiscrollview+pullload
- Import the file, #import "Uiscrollview+pullload.h"
Add the Pulldelegate agent, and add the following code
-(void) pulldownloadend { ; = YES; [Self startdownloaddata]; [Table Reloaddata]; [Table Stoploadwithstate:pulldownloadstate];} -(void) pulluploadend { ten; if + ) { = NO; } [Self startdownloaddata]; [Table Reloaddata]; [Table Stoploadwithstate:pulluploadstate];}
Note: This software is very simple to implement, but the effect is good, refresh the animation is not very well, there is a certain delay appear
Cocoachina website, Developer's code base, iOS development
IOS Development Pull-down refresh and pull-up load more