Two methods of pull refresh and drop refresh (including using third-party library Mjrefresh)
First, the use of Apple native method
1. Drop-down Refresh
2, Pull up refresh
(1 first to create a new footer Xib file, of course, including the corresponding controller files, such as in the Xib file can be dragged as follows the corresponding control
(2 Then write an instance method in the code file
+ (instancetype) footer
{
return [[[NSBundle Mainbundle] loadnibnamed:@ "xib filename" Owner:nil options:nil]lastobject];
}
(3 is then called in our list controller:
/**
* Integrated pull-up refresh control
*/
-(void) refreshupstatedatelist
{
Xbloadmorefooter *footer = [xbloadmorefooter footer];
Footer.hidden = yes;//was to be hidden from the beginning, and we just put it out when ScrollView dragged it to the bottom.
Self.tableView.tableFooterView = footer;//is actually equivalent to the Xib file as a tableView footer
}
(4 pull up to the bottom to call the method of refreshing more data
Second, the use of third-party library Mjrefresh
1. Drop-down Refresh
Abide by the agreement: <MJREFRESHBASEVIEWDELEGATE> and then actually use it as the header of the table view.
2. Drop-down Refresh
3, need to note: finally need dealloc
Pull-up refresh pull-down load