一个小的环形进度视图,看起来和 App Store 中使用的类似。
使用 CocoaPods 进行安装
pod "JESCircularProgressView"
将 JESCircularProgressView 添加到您的 xib/code 中,并更新其进度。
// YourAwesomeThing.h
#import "JESCircularProgressView.h"
...
@property (assign) IBOutlet JESCircularProgressView *circularProgressView;
// YourAwesomeThing.m
...
// And then you can be all like:
[self.circularProgressView setProgress:progress animated:YES];
// Or you could be like:
self.circularProgressView.progress = progress;
// But I made the whole animating thing so you might as well use it, right!?
您可以配置一些事情
/**
* The line width of the progress indicator.
*/
@property (nonatomic, assign) CGFloat progressLineWidth;
/**
* The line width of the outer circle.
*/
@property (nonatomic, assign) CGFloat outerLineWidth;
/**
* The duration of each animation.
*/
@property (nonatomic, assign) CGFloat animationDuration;
/**
* The color of the outer circle and progress line.
*/
@property (nonatomic, strong) NSColor *tintColor;