Hi Readers,
To refresh the table whenever you pull down the table, we need to use Refresh Control.
To add a UIRefreshControl on a TableView you just have to add a below code in your viewController.
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
[tableView addSubview:refreshControl];
Now in the selector method refresh:You can code according to your project what you need on the table refresh.
- (void)refresh:(UIRefreshControl *)refreshControl
{
// Do your job, when done:
}
Thanx for reading..:)
0 Comment(s)