Latest | 1.0.0 |
---|---|
Homepage | https://github.com/fphilipe/PHFRefreshControl |
License | MIT |
Platforms | ios 5.0, requires ARC |
Frameworks | QuartzCore |
Authors |
YAPTR™: Yet another pull-to-refresh. (Compose bar not included. See PHFComposeBarView if you like it.)
Why?
- Other existing solutions were quite complex and often implement an infinite scroll thingy and a last refresh date which I don’t need.
- These also often don’t work correctly if you use a top
contentInset
on the scroll view which I need. Heck not even Apple’s own UIRefreshControl respects that property.
Features
- No need to pull and release. Just pull far enough and a refresh will trigger. You’ll see much more of these soon.
- Adjust tint color of arrow.
- No support for last refresh date.
- Built on top of
UIControl
. When triggered it sends aUIControlEventValueChanged
event to targets. - View has a magical height of 44 points.
- iOS 5 and up (yeah, that’s a feature).
Installation
The prefered way is to use CococaPods.
pod 'PHFRefreshControl', '~> 1.0.0'
If you can’t use CocoaPods for some reason (you really should though, it’s the cool kid on the block), then grab the PHFRefreshControl.{h,m}
files and put it in your project. Make sure to add QuartzCore
framework if you haven’t already.
Usage
Adding a refresh control to a scroll view:
PHFRefreshControl *refreshControl = [PHFRefreshControl new];
[refreshControl setTintColor:tintColor];
[refreshControl addTarget:dataController
action:@selector(reload)
forControlEvents:UIControlEventValueChanged];
[scrollView setRefreshControl:refreshControl];
Triggering a refresh programmatically:
[[scrollView refreshControl] beginRefreshing];
work();
[[scrollView refreshControl] endRefreshing];
Small Print
License
PHFRefreshControl
is released under the MIT license.
Author
Philipe Fatio (@fphilipe)
Credits
The arrow drawing code was adapted from Sam Vermette’s SVPullToRefresh.
Latest podspec
{ "name": "PHFRefreshControl", "version": "1.0.0", "summary": "YAPTR(TM): Yet another pull-to-refresh.", "description": " * No need to pull and release. Just pull far enough and a refresh will trigger. You'll see much more of these soon.n * Adjust tint color of arrow.n * No support for last refresh date.n * Built on top of UIControl. When triggered it sends a UIControlEventValueChanged event to targets.n * View has a magical height of 44 points.n * iOS 5 and up (yeah, that's a feature).n", "homepage": "https://github.com/fphilipe/PHFRefreshControl", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Philipe Fatio": "[email protected]" }, "source": { "git": "https://github.com/fphilipe/PHFRefreshControl.git", "tag": "v1.0.0" }, "platforms": { "ios": "5.0" }, "source_files": "PHFRefreshControl.{h,m}", "preserve_paths": [ "LICENSE", "README.md" ], "frameworks": "QuartzCore", "requires_arc": true }
Sun, 28 Feb 2016 13:35:03 +0000