https://github.com/iliuchang/lcpullrefresh
Give pull-to-refresh to any UIScrollView.
https://github.com/iliuchang/lcpullrefresh
ios objective-c pull-to-refresh uicollectionview uiscrollview uitableview
Last synced: about 1 year ago
JSON representation
Give pull-to-refresh to any UIScrollView.
- Host: GitHub
- URL: https://github.com/iliuchang/lcpullrefresh
- Owner: iLiuChang
- License: mit
- Created: 2022-05-25T03:13:47.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-30T10:32:16.000Z (about 4 years ago)
- Last Synced: 2025-04-14T05:52:20.105Z (about 1 year ago)
- Topics: ios, objective-c, pull-to-refresh, uicollectionview, uiscrollview, uitableview
- Language: Objective-C
- Homepage:
- Size: 15.6 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```objective-c
[tableView lc_addHeaderRefreshingWithActionHandler:^{
}];
```
Manual refresh
```objective-c
[tableView lc_beginHeaderRefreshing];
```
### Drop down loading
Add dropdown trigger event
```objective-c
[tableView lc_addFooterRefreshingWithActionHandler:^{
}];
```
Add dropdown trigger event
```objective-c
[tableView lc_beginFooterRefreshing];
```
### End refresh
Because only one UIActivityIndicatorView is created, `lc_endRefreshing` will end all refreshes.
```objective-c
[self.tableView lc_endRefreshing];
```
### Set refresh direction
You can set horizontal or vertical refresh.
```objective-c
tableView.lc_refreshScrollDirection = LCRefreshScrollDirectionHorizontal;
```
## Installation
### CocoaPods
To integrate LCPullRefresh into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
pod 'LCPullRefresh'
```
### Manual
1. Download everything in the LCPullRefresh folder;
2. Add (drag and drop) the source files in LCPullRefresh to your project;
3. Import `UIScrollView+LCPullRefresh.h`.
## License
LCPullRefresh is provided under the MIT license. See LICENSE file for details.