prr

PRRefreshControl

Yet another and better refresh control for scroll views.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

50

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Categories

Readme

PRRefreshControl

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.

You can support me by:

:-)

Contact

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