Created
April 26, 2012 15:20
-
-
Save ninthspace/2500316 to your computer and use it in GitHub Desktop.
UITableViewController initializer with support for SVPullToRefresh
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
- (id)init { | |
self = [super initWithStyle:UITableViewStyleGrouped]; | |
if (self) { | |
// add the handler to the UITableView | |
[[self tableView] addPullToRefreshWithActionHandler:^{ | |
// do something, in this case add a new item to our data source | |
[self addNewItem:nil]; | |
// tell pull-to-refresh to stop animating | |
[[[self tableView] pullToRefreshView] stopAnimating]; | |
}]; | |
} | |
return self; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment