JTMaterialSpinner
iOS 物料设计旋转视图。
安装
使用 CocoaPods,将此行代码添加到您的 Podfile 中。
pod 'JTMaterialSpinner', '~> 3.0'
屏幕截图
使用方法
基本用法
import UIKit
import JTMaterialSpinner
class ViewController: UIViewController {
var spinnerView = JTMaterialSpinner()
override func viewDidLoad() {
super.viewDidLoad()
// Customize the line width
spinnerView.circleLayer.lineWidth = 2.0
// Change the color of the line
spinnerView.circleLayer.strokeColor = UIColor.orange.cgColor
// Change the duration of the animation
spinnerView.animationDuration = 2.5
}
func loadSomething () {
spinnerView.beginRefreshing()
MyService.loadSomeData() { () -> () in
spinnerView.endRefreshing()
}
}
}
需求
- iOS 8.0 或更高版本
- Swift 4.2
作者
许可
JTMaterialSpinner 采用 MIT 许可发布。有关更多信息,请参阅 LICENSE 文件。