Finally can pay my full attention to iOS development.
Basically this is a subclass of UITableViewController, which adds the functionality of pulling downward to refresh (or reload).
The following is the usage:
Copy the files into your project:
your table view controller should inherit from PPPullToRefreshTableViewController (which is a UITableViewController subclass), instead of the original UITableViewController
- in YourTableViewController.h
- #import "PPPullToRefreshTableViewController.h"
- @interface YourTableViewController : PPPullToRefreshTableViewController
- override the following method:
- - (void) refreshing
- you should call didRefresh inside this method in order to hide the refresh header view
- you may want to call willRefresh to start refreshing in code (this method by default shows the refresh header view, and calls refreshing automatically)
In your build target's Link Binbary with Libraries section, add the QuartzCore.framework
You may clone the demo project, which is a Master-Detail application together with the PPPullToRefreshTableViewController source code, from here:
git clone git://github.com/peterwongpp/PPPullToRefreshTableViewController.git
The project's repository: PPPullToRefreshTableViewController
Any pull requests, discussions or issues are welcome!