https://github.com/jerry0523/jwrefreshcontrol
A refresh control(header & footer of UIScrollview) for iOS app.
https://github.com/jerry0523/jwrefreshcontrol
cocoapods ios refreshcontrol swift
Last synced: 7 months ago
JSON representation
A refresh control(header & footer of UIScrollview) for iOS app.
- Host: GitHub
- URL: https://github.com/jerry0523/jwrefreshcontrol
- Owner: Jerry0523
- License: mit
- Created: 2017-11-09T05:44:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-18T14:05:29.000Z (over 6 years ago)
- Last Synced: 2025-08-10T03:03:05.044Z (7 months ago)
- Topics: cocoapods, ios, refreshcontrol, swift
- Language: Swift
- Homepage:
- Size: 4.26 MB
- Stars: 17
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/Jerry0523/JWRefreshControl)
[](https://img.shields.io/cocoapods/v/JWRefreshControl.svg)
# JWRefreshControlDemo
A refresh control(refresh header & footer for scrollview) for iOS app.

Usage
-------
### Add a refresh header
```swift
self.tableView.addRefreshHeader { [weak self] (header) in
//fetch data and reload UI
}
```
### Add a refresh footer
```swift
self.tableView.addRefreshFooter { [weak self] (footer) in
//fetch data and reload UI
}
```
### Custom Content View Supported
```swift
self.webView.scrollView.addCustomRefreshHeader { [weak self] (header: RefreshHeaderControl) in
self?.webView.reload()
header.success()
}
```
### Completion Handler
- Notify refresh successfully
```swift
self.tableView.refreshHeader.success()
```
- Notify refresh error
```swift
self.tableView.refreshHeader.error("Network Error")
```
- Notify no more data
```swift
self.tableView.refreshFooter.pause("No More Data")
```
- Notify fetch task to stop
```swift
self.tableView.refreshHeader.stop()
```
## Installation with CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries. You can install it with the following command:
```bash
$ gem install cocoapods
```
#### Podfile
To integrate JWIntent into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'JWRefreshControl'
```
Then, run the following command:
```bash
$ pod install
```
License
-------
(MIT license)