WavePullToRefresh is "Pull To Refresh" Library. You can add animated "Pull To Refresh" action to your Class extends UIScrollView.
- Import WavePullToRefreshView
import WavePullToRefreshView
- Add "Pull To Refresh" to your Class that extends UIScrollView.
self.tableView.addPullToRefresh { [weak self] in
yourAsyncTask(completion: {
self?.tableView.stopPullToRefresh()
})
}
let options = WavePullToRefreshOption()
options.fillColor = UIColor.re.CGColor
let imageView = UIImageView(image: UIImage(named: "Image"))
options.indicatorImageView = imageView
self.tableView.addPullToRefresh(options: options) { [weak self] in
yourAsyncTask(completion: {
self?.tableView.stopPullToRefresh()
})
}
The trigger offsetY of starting animation.
default: 80
public var animationStartOffsetY: CGFloat = 80
(millisec)
default: 0.75
public var dropDuration: NSTimeInterval = 0.75
The position that the drop finish dropping.
default: screen height * 0.85
public var dropY: CGFloat = UIScreen.mainScreen().bounds.height * 0.85
default: color of screenshot
public var fillColor = UIColor(red: 106/255, green: 172/255, blue: 184/255, alpha: 1).CGColor
default: white
public var indicatorColor = UIColor.whiteColor().CGColor
ImgeView in dropping.
default: nil
public var indicatorImageView: UIImageView?
Swift 2.2+ Xcode 7.3+ iOS 8.0+
WavePullToRefresh is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "WavePullToRefresh"
If you don't use CocoaPods, just add Class folder into your project.
WaveSwipeRefresh is owned and maintained by RECRUIT LIFESTYLE CO., LTD.
WaveSwipeRefresh was originally created by Daisuke Kobayashi
Copyright 2016 RECRUIT LIFESTYLE CO., LTD.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.