Pull to refresh control for iOS 5 and above. Design and interface mimics the iOS 6 UIRefreshControl. SCRefreshControl can be used with any UIScrollView, it is not limited to usage with only a UITableViewController.
The refresh control can be used three ways:
- SCRefreshTableViewController - UITableViewController
SCRefreshTableViewController *controller;
controller.refresh = [[SCRefreshControl alloc] init];
[controller.refresh addTarget:self action:@selector(startRefresh:) forControlEvents:UIControlEventValueChanged];
- SCRefreshViewController - UIViewController with UIScrollView component
SCRefreshViewController *controller;
controller.refresh = [[SCRefreshControl alloc] init];
[controller.refresh addTarget:self action:@selector(startRefresh:) forControlEvents:UIControlEventValueChanged];
- Directly with a UIScrollView in own custom controller
UIScrollView *scrollView;
SCRefreshControl *refresh = [[SCRefreshControl alloc] init];
[refresh addTarget:self action:@selector(startRefresh:) forControlEvents:UIControlEventValueChanged];
[scrollView addSubview:refresh];
- Copy SCRefreshControl folder into your project
- Link against the QuartzCore framework
- Either extend SCRefreshViewController or SCRefreshTableViewController and follow example usage, or add the control to any UIScrollView as in the example usage. See the demo project for further details and how to customize the appearance.
SCRefreshControl, and all the accompanying source code, is released under the MIT license