KoaPullToRefresh 1.0.6

KoaPullToRefresh 1.0.6

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total8,696
Week0
Month0

Installs

Apps192
Test Targets16
powered by Segment

GitHub

Stars91
Watchers5
Forks21
Issues6
Contributors2
Pull Requests4

Code

Files2
LOCLines of Code 364


  • By
  • Sergi Gracia and Polina Flegontovna

KoaPullToRefresh is a minimal & easily customizable pull-to-refresh control. You can change the font, colors, size and even replace the spinning icon using FontAwesome. This library is very easy to add and customize. This pull to refresh control is developed for Teambox and is based on the SVPullToRefresh and use ios-fontawesome to work with font awesome icons.

Installation

Manually

  1. Drag the KoaPullToRefresh/KoaPullToRefresh folder into your project.
  2. Add the QuartCore framework to your project.
  3. Edit your app's Info.plist to contain the key: "Fonts provided by application" (UIAppFonts). Then add FontAwesome.ttf to the list under that key.
  4. Import KoaPullToRefresh.h.

Usage

Adding KoaPullToRefresh

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 KoaPullToRefresh

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:KoaPullToRefreshStateStopped];
[self.tableView.pullToRefreshView setTitle:@"Release" forState:KoaPullToRefreshStateTriggered];
[self.tableView.pullToRefreshView setTitle:@"Loading" forState:KoaPullToRefreshStateLoading];

Manage KoaPullToRefresh

Start animating KoaPullToRefresh (viewDidLoad)

[self.tableView.pullToRefreshView startAnimating];

Stop animating KoaPullToRefresh

[self.tableView.pullToRefreshView stopAnimating];

Requirements

  • iOS >= 5.0
  • ARC

Contact

License

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

githalytics.com alpha