要运行示例项目目录。
// Initialize the progress view
let loadingView:ZXLoadingView = ZXLoadingView.init(frame:CGRect.init(x: self.view.center.x, y: self.view.center.y, width: 100, height: 100))
// Set the line width of the loadingView
loadingView.lineWidth = 2.0
// Set the tint color of the loadingView
loadingView.tintColor = .red
// Add it as a subview
self.view.addSubview(loadingView)
...
// Start & stop animations
loadingView.startAnimating()
loadingView.stopAnimating()
也支持 Xib 与 Storyboard
即使在动画开始后,也可设置 lineWidth
与 tintColor
属性,这在附带的示例项目中可以进行观察。
swift4.0
ZXLoadingView 可以通过 CocoaPods 获得。要安装它,请简单地将以下行添加到您的 Podfile 中
然后,在终端内运行 pod install
,或者从 CocoaPods.app 运行。
pod 'ZXLoadingView'
zxin2928, [email protected]
ZXLoadingView 在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。