LCPullRefresh
Use UIActivityIndicatorView to provide a pull-to-refresh function for UIScrollView.
Requirements
- iOS 8.0+
- Xcode 11.0+
Usage
Pull-up refresh
Add pull-up trigger event
[tableView lc_addHeaderRefreshingWithActionHandler:^{
}];
Manual refresh
[tableView lc_beginHeaderRefreshing];
Drop down loading
Add dropdown trigger event
[tableView lc_addFooterRefreshingWithActionHandler:^{
}];
Add dropdown trigger event
[tableView lc_beginFooterRefreshing];
End refresh
Because only one UIActivityIndicatorView is created, lc_endRefreshing
will end all refreshes.
[self.tableView lc_endRefreshing];
Set refresh direction
You can set horizontal or vertical refresh.
tableView.lc_refreshScrollDirection = LCRefreshScrollDirectionHorizontal;
Installation
CocoaPods
To integrate LCPullRefresh into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'LCPullRefresh'
Manual
- Download everything in the LCPullRefresh folder;
- Add (drag and drop) the source files in LCPullRefresh to your project;
- Import
UIScrollView+LCPullRefresh.h
.
License
LCPullRefresh is provided under the MIT license. See LICENSE file for details.