<commit_before># CKRefreshControl

Open source 100% API-compatible replacement for `UIRefreshControl`, supporting iOS 5.0+

Using it is as simple as this:

    #import <CKRefreshControl/CKRefreshControl.h>

    UITableViewController *controller;

    CKRefreshControl *refreshControl = [CKRefreshControl new];
    [refreshControl addTarget:self action:@selector(doRefresh:) forControlEvents:UIControlEventValueChanged];
    controller.refreshControl = (id)refreshControl;

Then just link against the static library the `CKRefreshControl` project provides, and you're ready to go.

![iOS 5 example](/instructure/CKRefreshControl/raw/readme-resources/iOS5.png) &nbsp; 
![iOS 6 example](/instructure/CKRefreshControl/raw/readme-resources/iOS6.png)

----

### API Compatible

CKRefreshControl has exactly the same public API as UIRefreshControl. Thus, your code can treat either one as an instance of the other. Just use CKRefreshControl instead of UIRefreshControl everywhere, and you'll magically get iOS 5 support.

We take advantage of this to provide excellent iOS 6 compatibility. When running on an iOS 6 device, `-[CKRefreshControl init]` actually returns a `UIRefreshControl` instance. No CKRefreshControl is ever initialized, and everything will work exactly as if CKRefreshControl did not even exist.

You can even use the `+appearance` proxies introduced in iOS 5.0; CKRefreshControl will appropriately forward the customizations to UIRefreshControl on iOS 6.

There is only one minor inconvenience. The `-[UITableViewController setRefreshControl:]` method in iOS 6 accepts a `UIRefreshControl *` parameter. Although CKRefreshControl is API compatible with UIRefreshControl, it is not a subclass (so it can be used on iOS 5). Thus, the compiler does not know that CKRefreshControl can be used as a UIRefreshControl. Thus, you must add an explicit cast to avoid a compiler warning. This is completely safe.

---

### Appearance

CKRefreshControl intentionally does not mimic the iOS 6 UIRefreshControl look and feel. Instead, it was designed to look more like the other pull-to-refresh controls commonly used in iOS 5 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.

Despite the difference in interface between iOS 5 and iOS 6, CKRefreshControl supports the  same properties UIRefreshControl does.

---
<commit_msg>Call out need for `-ObjC` linker flag in readme<commit_after># CKRefreshControl

Open source 100% API-compatible replacement for `UIRefreshControl`, supporting iOS 5.0+

Using it is as simple as this:

    #import <CKRefreshControl/CKRefreshControl.h>

    UITableViewController *controller;

    CKRefreshControl *refreshControl = [CKRefreshControl new];
    [refreshControl addTarget:self action:@selector(doRefresh:) forControlEvents:UIControlEventValueChanged];
    controller.refreshControl = (id)refreshControl;

Then just link against the static library the `CKRefreshControl` project provides, add the `-ObjC` linker flag, and you're ready to go.

![iOS 5 example](/instructure/CKRefreshControl/raw/readme-resources/iOS5.png) &nbsp; 
![iOS 6 example](/instructure/CKRefreshControl/raw/readme-resources/iOS6.png)

----

### API Compatible

CKRefreshControl has exactly the same public API as UIRefreshControl. Thus, your code can treat either one as an instance of the other. Just use CKRefreshControl instead of UIRefreshControl everywhere, and you'll magically get iOS 5 support.

We take advantage of this to provide excellent iOS 6 compatibility. When running on an iOS 6 device, `-[CKRefreshControl init]` actually returns a `UIRefreshControl` instance. No CKRefreshControl is ever initialized, and everything will work exactly as if CKRefreshControl did not even exist.

You can even use the `+appearance` proxies introduced in iOS 5.0; CKRefreshControl will appropriately forward the customizations to UIRefreshControl on iOS 6.

There is only one minor inconvenience. The `-[UITableViewController setRefreshControl:]` method in iOS 6 accepts a `UIRefreshControl *` parameter. Although CKRefreshControl is API compatible with UIRefreshControl, it is not a subclass (so it can be used on iOS 5). Thus, the compiler does not know that CKRefreshControl can be used as a UIRefreshControl. Thus, you must add an explicit cast to avoid a compiler warning. This is completely safe.

---

### Appearance

CKRefreshControl intentionally does not mimic the iOS 6 UIRefreshControl look and feel. Instead, it was designed to look more like the other pull-to-refresh controls commonly used in iOS 5 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.

Despite the difference in interface between iOS 5 and iOS 6, CKRefreshControl supports the  same properties UIRefreshControl does.

---

{'fraction_non_alphanumeric': 0.059114315139031925, 'fraction_numerical': 0.009474768280123584, 'mean_word_length': 4.980295566502463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1579241', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1215, 'n_words': 609}