ESPullToRefresh
An easy way to use pull to refresh and infinite scrolling in Swift. Pod 'ESPullToRefresh'
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 2.3 or later
Features
- Support
UIScrollView
and its subclassesUICollectionView
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
Carthage
Manually
Usage
Default style:
Add ESPullToRefresh
to your project
Add default pull-to-refresh
Add default infinite-scrolling
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
Add customize infinite-scrolling
Espried and auto refresh
ESPullToRefresh support for the latest expiration time and the cache refresh time, You need set an refreshIdentifier
to your UIScrollView.
You can use es_autoPullToRefresh()
method, when the time over the last refresh interval expires automatically refreshed.