MKMagneticProgress
MKMagneticProgress
IOS 上的 Swift 编写的环形进度条
特性
- 界面构建器可设计
- 高度自定义和灵活
- 易于使用
- 使用 Swift 编写
安装
CocoaPods(推荐)
- 安装 CocoaPods
- 将此仓库添加到您的
Podfile
target 'Example' do
# IMPORTANT: Make sure use_frameworks! is included at the top of the file
use_frameworks!
platform :ios, '8.0'
pod 'MKMagneticProgress'
end
- 运行
pod install
- 打开 CocoaPods 创建的
.xcworkspace
- 完成!
手动
直接从这里下载 MKMagneticProgress.swift
文件到您的项目中,确保指向您项目的目标
使用
Interface Builder
只需将一个 UIView
拖到您的 Storyboard 上。确保将 MKMagneticProgress
子类化,并将模块指向 MKMagneticProgress
。
随心所欲地进行设计
使用
import MKMagneticProgress
@IBOutlet weak var magProgress:MKMagneticProgress!
override func viewDidLoad() {
magProgress.setProgress(progress: 0.5, animated: true)
magProgress.progressShapeColor = UIColor.blue
magProgress.backgroundShapeColor = UIColor.yellow
magProgress.titleColor = UIColor.red
magProgress.percentColor = UIColor.black
magProgress.lineWidth = 10
magProgress.orientation = .top
magProgress.lineCap = .round
magProgress.title = "Title"
magProgress.percentLabelFormat = "%.2f%%"
}
示例项目
请查看这里的示例项目
- 下载它
- 在Xcode中打开
Example.xcworkspace
- 享受吧!
作者
Moayad Al kouz, [email protected]
Twitter : @malkouz许可证
MKMagneticProgress遵循MIT许可证。详情请参阅LICENSE文件。