Here's what you can do with iOS 6 and later:
- (void)viewDidLoad { // other initialization self.refreshControl = [[UIRefreshControl alloc] init]; [self.refreshControl addTarget:self action:@selector(myRefresh) forControlEvents:UIControlEventValueChanged]; }
Your update method:
- (void)myRefresh {
You finish the update in reloadData:
- (void)reloadData { [self.tableView reloadData]; // End the refreshing if (self.refreshControl) { [self.refreshControl endRefreshing]; } }
Then you are all set!
us_david Feb 10 '15 at 2:24 2015-02-10 02:24
source share