Skip to content

DRKPullToRefresh is a pull to refresh component that used the SpinKit animations. The source is based on the excellent SVPullToRefresh and good looking KoaPullToRefresh

License

Notifications You must be signed in to change notification settings

govi/DRKPullToRefresh

 
 

Repository files navigation

DRKPullToRefresh Build Status

DRKPullToRefresh is a clean and customisable pull-to-refresh component that uses SpinKit animations. You can change the font, colors, size and animations from SpinKit. This is based on KoaPullToRefresh that sports a very simple and clear design.

Installation

From CocoaPods [Not ready yet]

  1. Add pod 'DRKPullToRefresh' to your Podfile.

Manually

  1. Drag the DRKPullToRefresh/DRKPullToRefresh folder into your project.
  2. Add the QuartCore framework to your project.
  3. Import DRKPullToRefresh.h.

Usage

Adding DRKPullToRefresh

Add this in your viewDidLoad:

[tableView addPullToRefreshWithActionHandler:^{
	// Tasks to do on refresh. Update datasource, add rows, …
	// Call [tableView.pullToRefreshView stopAnimating] when done.
}];

Adding background color:

[tableView addPullToRefreshWithActionHandler:^{
	// Tasks to do on refresh. Update datasource, add rows, …
	// Call [tableView.pullToRefreshView stopAnimating] when done.
} withBackgroundColor:[UIColor blueColor]];

Adding the height of showed pixels:

[tableView addPullToRefreshWithActionHandler:^{
	// Tasks to do on refresh. Update datasource, add rows, …
	// Call [tableView.pullToRefreshView stopAnimating] when done.
} withBackgroundColor:[UIColor blueColor] withPullToRefreshHeightShowed:2];

Customize DRKPullToRefresh

Set the color of fontAwesome icon and text:

[self.tableView.pullToRefreshView setTextColor:[UIColor whiteColor]];

Set the text font:

[self.tableView.pullToRefreshView setTextFont:[UIFont fontWithName:@"OpenSans-Bold" size:14]];

Set the font awesome icon:

[self.tableView.pullToRefreshView setFontAwesomeIcon:@"icon-refresh"];

Set titles:

[self.tableView.pullToRefreshView setTitle:@"Pull" forState:DRKPullToRefreshStateStopped];
[self.tableView.pullToRefreshView setTitle:@"Release" forState:DRKPullToRefreshStateTriggered];
[self.tableView.pullToRefreshView setTitle:@"Loading" forState:DRKPullToRefreshStateLoading];

Manage DRKPullToRefresh

Start animating DRKPullToRefresh (viewDidLoad)

[self.tableView.pullToRefreshView startAnimating];

Stop animating DRKPullToRefresh

[self.tableView.pullToRefreshView stopAnimating];

Requirements

  • iOS >= 5.0
  • ARC

Contact

  • govirulez at gmail dot com

License

DRKPullToRefresh is available under the MIT License. See the License file for more info.

About

DRKPullToRefresh is a pull to refresh component that used the SpinKit animations. The source is based on the excellent SVPullToRefresh and good looking KoaPullToRefresh

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.1%
  • Ruby 1.9%