Implement tableview pull-down refresh and tableview pull-down refresh
Implement drop-down refresh of tableview
Recommended third-party pull-down refresh code http://code4app.com/ios/%E5%BF% AB %E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
Does tableview sliding trigger this method?
-(Void) tableView :( UITableView *) tableView willDisplayCell :( UITableViewCell *) cell forRowAtIndexPath :( NSIndexPath *) indexPath {// if (indexPath) is triggered only when tableview is pulled down to the last row. row = self. m_data.count-1) {// define a UIViewUIView * footSpinnerView = [[UIView alloc] initWithFrame: CGRectMake (0.0f, 0.0f, 3200000f, 601_f)]; // view UIActivityIndicatorView * activity = [[UIActivityIndicatorView alloc] initWithFrame: CGRectMake (130.0f, 0.0f, 601_f, 601_f)]; activity. color = [UIColor redColor]; [activity startAnimating]; // start the view footSpinnerView with a new image. backgroundColor = [UIColor grayColor]; [footSpinnerView addSubview: activity]; // set footerview self. myTableView. tableFooterView = footSpinnerView; // self. myTableView. tableHeaderView = footSpinnerView; dispatch_queue_t queue = dispatch_queue_create ("my queue", nil); // Add data dispatch_async (queue, ^ (void) {[self. m_data addObject: @" 1000 "]; [self. m_data addObject: @" 1001 "]; [self. m_data addObject: @" 1002 "]; [self. m_data addObject: @" 1003 "]; [self. m_data addObject: @ "1004"] ;}); // reload the data after adding the data dispatch_async (queue, ^ (void) {sleep (2 ); dispatch_sync (dispatch_get_main_queue (), ^ (void) {[self. myTableView reloadData];}) ;}); // [self. myTableView reloadData]; dispatch_release (queue); [footSpinnerView release]; [activity release] ;}}