测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
发布了最新版本 | 2017 年 8 月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Andrea Mazzini 维护。
为 UIRefreshControl 自定义动画。灵感来自这个 Dribble 图片 和 这篇教程。
通过 CocoaPods 安装
pod 'GearRefreshControl', '~> 1.0.0'
use_frameworks!
设置你的 refreshControl
override func viewDidLoad() {
super.viewDidLoad()
gearRefreshControl = GearRefreshControl(frame: self.view.bounds)
gearRefreshControl.addTarget(self, action: #selector(ViewController.refresh), for: UIControlEvents.valueChanged)
self.refreshControl = gearRefreshControl
}
更新状态
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
gearRefreshControl.scrollViewDidScroll(scrollView)
}
在完成时停止动画
self.gearRefreshControl.endRefreshing()
您可以通过设置 gearTintColor
属性来自定义控件的颜色
gearRefreshControl.gearTintColor = .red
查看示例项目以查看完整实现。
Andrea Mazzini。我可以接受自由工作,欢迎联系我。
想要支持这些免费库的开发吗?买我一杯咖啡
感谢 每一个 足够好,提交了合并请求的人。
Copyright (c) 2017 Andrea Mazzini. All rights reserved.
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.