Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 2 months ago
JSON representation

Give pull-to-refresh to any UIScrollView.

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.