Latest 0.2.1
Homepage https://github.com/Elethom/PRRefreshControl
License MIT
Platforms ios 5.0, requires ARC
Authors

CocoaPods
Language
License

Tweet
Twitter

Yet another and better refresh control for scroll views.

Installation

With CocoaPods

In your Podfile:

pod 'PRRefreshControl'

Usage

Setup in -viewDidLoad in your view controller class:

- (void)viewDidLoad
{
    [super viewDidLoad];

    ...

    PRRefreshControl *refreshControl = [[PRRefreshControl alloc] init];
    [refreshControl addTarget:self
                       action:@selector(refreshControlTriggered:)
             forControlEvents:UIControlEventValueChanged];
    self.refreshControl = refreshControl;
    [collectionView insertSubview:refreshControl atIndex:0];

    // Configure manually if needed
    CGFloat customMarginTop = 10.f;
    refreshControl.scrollViewContentInset = collectionView.contentInset;
    refreshControl.height -= customMarginTop;
    refreshControl.verticalOffset = customMarginTop * .5f;

    ...

}

Respond to actions:

#pragma mark - Data

- (void)dataDidRefresh
{
    [self.refreshControl endRefreshing];
}

#pragma mark - Actions

- (void)refreshControlTriggered:(PRRefreshControl *)sender
{
    [self refreshData];
}

All done!

License

This code is distributed under the terms and conditions of the MIT license.

Donate

You can support me by:

:-)

Contact

Latest podspec

{
    "name": "PRRefreshControl",
    "version": "0.2.1",
    "summary": "Yet another and better refresh control for scroll views.",
    "homepage": "https://github.com/Elethom/PRRefreshControl",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Elethom Hunter": "[email protected]"
    },
    "social_media_url": "https://twitter.com/ElethomHunter",
    "platforms": {
        "ios": "5.0"
    },
    "source": {
        "git": "https://github.com/Elethom/PRRefreshControl.git",
        "tag": "0.2.1"
    },
    "source_files": "Classes/*.{h,m}",
    "public_header_files": "Classes/*.h",
    "resources": "Resources/PRRefreshControl.bundle",
    "requires_arc": true
}

Pin It on Pinterest

Share This