Last active
December 15, 2015 01:09
-
-
Save isthisjoe/5178025 to your computer and use it in GitHub Desktop.
UIRefreshControl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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