CKRefreshControl

A pull-to-refresh view for iOS 5, 100% API-compatible with UIRefreshControl in iOS 6

Showing:

Popularity

Downloads/wk

0

GitHub Stars

291

Maintenance

Last Commit

8yrs ago

Contributors

5

Package

Dependencies

0

License

MIT

Categories

Readme

CKRefreshControl

Open source library providing iOS 5.0+ support for UIRefreshControl, which was introduced in iOS 6.0.

Using it is as simple as this:

UITableViewController *controller;

controller.refreshControl = [[UIRefreshControl alloc] init];
[controller.refreshControl addTarget:self action:@selector(doRefresh:) forControlEvents:UIControlEventValueChanged];

Yes, that's exactly the code you'd write on iOS 6. No changes required.

You can also configure the refresh control in a storyboard, or use the +appearance API proxies if you'd like. It all works just like you'd hope, but now you can deploy it back to iOS 5.0 as well. Just link against the static library the CKRefreshControl project provides, add the -ObjC linker flag, and you're ready to go.

iOS 5 example   iOS 6 example


Appearance

CKRefreshControl intentionally does not mimic the iOS 6 UIRefreshControl look and feel for iOS 5.0. Instead, it was designed to look more like the other pull-to-refresh controls commonly used in iOS 5-compatible apps. Thus, whether the user is running iOS 5 or iOS 6, they get an interface that fits in with other apps on the device.


Why the name?

CKRefreshControl was originally part of our internal "CanvasKit" library, used in building Instructure's iOS apps.


Implementation

In general, you won't even know you're using CKRefreshControl. On iOS 5, we register UIRefreshControl as a subclass of CKRefreshControl, which implements all the compatibility stuff. On iOS 6, we just get out of the way; UIRefreshControl is available natively, and we don't have to do anything.


But does it work?

Yes! Instructure is using it in shipping code with no problems. That said, if you find a bug, please let us know and we'll make it work.


Contributors


License

CKRefreshControl, and all the accompanying source code, is released under the MIT license. You can see the full text of the license in the accompanying LICENSE.txt file.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial