Skip to content

Instantly share code, notes, and snippets.

@isthisjoe
Last active December 15, 2015 01:09
Show Gist options
  • Save isthisjoe/5178025 to your computer and use it in GitHub Desktop.
Save isthisjoe/5178025 to your computer and use it in GitHub Desktop.
UIRefreshControl
- (void)setupRefreshControl
{
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to refresh"];
[refreshControl addTarget:self
action:@selector(refreshControlAction:)
forControlEvents:UIControlEventValueChanged];
self.refreshControl = refreshControl;
}
- (void)refreshControlAction:(id)sender
{
[self.tableView reloadData];
[self.refreshControl endRefreshing];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment