This repository has been archived by the owner. It is now read-only.
A pull-to-refresh view for iOS 5, 100% API-compatible with UIRefreshControl in iOS 6
Objective-C Ruby
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
CKRefreshControl.xcodeproj making CKParagraphStyle.h is now a private header Jan 24, 2013
CKRefreshControl
RefreshControlDemo.xcodeproj add -ObjC linker flag to RefreshControlDemo means we no longer have t… Jan 24, 2013
RefreshControlDemo switching CKRefreshControl reference to UIRefreshControl when calling… Jan 26, 2013
.gitignore using .gitignore to ignore unwanted Xcode files Jan 3, 2013
CKRefreshControl.podspec Update podspec to 1.1.1, with Xcode 5 fixes Sep 23, 2013
LICENSE.txt Add github readme and license file. Oct 22, 2012
README.md

README.md

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.