2012-04-23 16:50:02 -04:00
2012-04-23 16:50:02 -04:00
2012-04-23 16:50:02 -04:00
2012-04-23 16:50:02 -04:00
2012-04-23 16:50:02 -04:00
2012-04-23 16:50:02 -04:00

h1. SVPullToRefresh

SVPullToRefresh allow you to easily add pull-to-refresh functionality to any UIScrollView subclass. Instead of depending on delegates and/or subclassing UIViewController, SVPullToRefresh extends UIScrollView with:

* a - (void)addPullToRefreshWithActionHandler:(void (^)(void))actionHandler method
* a @pullToRefreshView@ property

h2. Installation

* Drag the @SVPullToRefresh/SVPullToRefresh@ folder into your project. 
* Add the *QuartzCore* framework to your project.
* @#import "SVPullToRefresh.h"@

h2. Usage

(see sample Xcode project in @/Demo@)

Adding pull-to-refresh to a table view can be done with one single line of code:

<pre>
[tableView addPullToRefreshWithActionHandler:^{
    // refresh data
	// call [tableView.pullToRefreshView stopAnimating] when done
}];
</pre>

h2. Customization

The SVPullToRefresh view can be customized with the following properties:

<pre>
@property (nonatomic, strong) UIColor *arrowColor;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, readwrite) UIActivityIndicatorViewStyle activityIndicatorViewStyle;
</pre>

h2. Under the hood

SVPullToRefresh extends UIScrollView by adding a new public method as well as a dynamic property (thanks @seb_morel!). It uses key-value observing to track the scrollView's contentOffset, which removes the need for the view to be linked to the UIScrollViewDelegate protocol.

h2. Credits

SVPullToRefresh is brought to you by "Sam Vermette":http://samvermette.com and "contributors to the project":https://github.com/samvermette/SVPullToRefresh/contributors. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by "creating new issues":https://github.com/samvermette/SVPullToRefresh/issues/new. If you're using SVPullToRefresh in your project, attribution would be nice. Big thanks to @seb_morel for his "Demistifying the Objective-C runtime":http://cocoaheadsmtl.s3.amazonaws.com/demistifying-runtime.pdf which permitted the high abstraction of this class.
Description
No description provided
Readme 205 KiB
Languages
Objective-C 97.7%
Ruby 2.3%