Need help with pull-to-refresh?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

eggswift
1.5K Stars 224 Forks MIT License 155 Commits 79 Opened issues

Description

#Busy Re-Building....# An easy way to use pull to refresh and infinite scrolling in Swift. Pod 'ESPullToRefresh'

Services available

!
?

Need anything else?

Contributors list

# 13,508
Swift
iOS
tabbar
tabbarc...
71 commits
# 148,611
MATLAB
swift3
collect...
scrollv...
4 commits
# 94,688
Swift
swift3
webview
scrollv...
2 commits
# 73,118
Objecti...
alfred
wechat
esoteri...
2 commits
# 46,453
mac
detect-...
carthag...
photo-b...
2 commits
# 72,506
Objecti...
actions...
qq
swift3
2 commits
# 204,581
Swift
watchos
swift3
scrollv...
2 commits
# 284,461
Objecti...
swift3
collect...
scrollv...
1 commit
# 284,007
Objecti...
swift3
collect...
scrollv...
1 commit
# 187,042
micropa...
Shell
Objecti...
swift3
1 commit
# 238,533
Swift
swift3
scrollv...
Shell
1 commit
# 283,662
Objecti...
Shell
swift3
collect...
1 commit
# 40,791
opencl
swagger
swagger...
textedi...
1 commit
# 69,849
alpine
Docker
CSS
matterm...
1 commit
# 282,513
Objecti...
swift3
collect...
scrollv...
1 commit
# 215,195
Shell
C
kalman-...
Android
1 commit
# 59,325
appletv
swift-3
custom-...
Xcode
1 commit
# 175,573
in-app-...
iOS
swift-3
macOS
1 commit

Travis CocoaPods Carthage Compatible Swift v3 Twitter Twitter

中文介绍

ESPullToRefresh is an easy-to-use component that give pull-to-refresh and infinite-scrolling implemention for developers. By extension to UIScrollView, you can easily add pull-to-refresh and infinite-scrolling for any subclass of UIScrollView. If you want to customize its UI style, you just need conform the specified protocol.

Requirements

  • Xcode 8 or later
  • iOS 8.0 or later
  • ARC
  • Swift 5.0 or later

Features

  • Support
    UIScrollView
    and its subclasses
    UICollectionView
    UITableView
    UITextView
  • Pull-Down to refresh and Pull-Up to load more
  • Support customize your own style(s)

Demo

Download and run the ESPullToRefreshExample project in Xcode to see ESPullToRefresh in action.

Installation

CocoaPods

pod "ESPullToRefresh"

Carthage

github "eggswift/pull-to-refresh"

Manually

git clone https://github.com/eggswift/pull-to-refresh.git
open ESPullToRefresh

Usage

Default style:

Add

ESPullToRefresh
to your project
import ESPullToRefresh

Add default pull-to-refresh

self.tableView.es.addPullToRefresh {
    [unowned self] in
    /// Do anything you want...
    /// ...
    /// Stop refresh when your job finished, it will reset refresh footer if completion is true
    self.tableView.es.stopPullToRefresh(completion: true)
    /// Set ignore footer or not
    self.tableView.es.stopPullToRefresh(completion: true, ignoreFooter: false)
}

Add default infinite-scrolling

swift
self.tableView.es.addInfiniteScrolling {
    [unowned self] in
    /// Do anything you want...
    /// ...
    /// If common end
    self.tableView.es.stopLoadingMore()
    /// If no more data
    self.tableView.es.noticeNoMoreData()
}

Customize Style

As effect:

PS: Load effect is from MeiTuan iOS app.

Customize refresh need conform the ESRefreshProtocol and ESRefreshAnimatorProtocol protocol.

Add customize pull-to-refresh

func es.addPullToRefresh(animator animator: protocol, handler: ESRefreshHandler)

Add customize infinite-scrolling

func es.addInfiniteScrolling(animator animator: protocol, handler: ESRefreshHandler)

Espried and auto refresh

ESPullToRefresh support for the latest expiration time and the cache refresh time, You need set an

refreshIdentifier
to your UIScrollView.
swift
scrollView.refreshIdentifier = "Your Identifier" // Set refresh identifier
scrollView.expriedTimeInterval = 20.0 // Set the expiration interval
You can use
es.autoPullToRefresh()
method, when the time over the last refresh interval expires automatically refreshed. ``` swift scrollView.es.autoPullToRefresh()

let expried = scrollView.espried // expired or not ```

Remove

func es.removeRefreshHeader()
func es.removeRefreshFooter()

Sponsor

You can support the project by checking out our sponsor page. It takes only one click:

git-ad
This advert was placed by GitAds

About

ESPullToRefresh is developed and maintained by Vincent Li. If you have any questions or issues in using ESPullToRefresh, welcome to issue. If you want to contribute to ESPullToRefresh, Please submit Pull Request, I will deal with it as soon as possible.

Twitter URL Twitter Follow

License

The MIT License (MIT)

Copyright (c) 2013-2020 eggswift

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.