UINavigationBar 上显示类似 Safari 进度视图的分类
Cocoapods: pod 'SGNavigationProgress'
手动:将 UINavigationController+SGProgress.h 和 UINavigationController+SGProgress.m 添加到您的项目中,并导入 .h 文件
[self.self.navigationController showSGProgress]; //默认为3秒
[self.navigationController showSGProgressWithDuration:3]; //使用navbar的tintColor
[self.navigationController showSGProgressWithDuration:3 andTintColor:[UIColor blueColor];
[self.navigationController showSGProgressWithDuration:3 andTintColor:[UIColor blueColor] andTitle:@"发送..."];
[self.navigationController showSGProgressWithMaskAndDuration:3];
[self.navigationController showSGProgressWithMaskAndDuration:3 andTitle:@"发送..."];
[self.navigationController finishSGProgress]; //提前结束动画
- (void)setSGProgressPercentage:(float)percentage;
- (void)setSGProgressPercentage:(float)percentage andTitle:(NSString *)title;
- (void)setSGProgressPercentage:(float)percentage andTintColor:(UIColor *)tintColor;
- (void)setSGProgressMaskWithPercentage:(float)percentage;
- (void)setSGProgressMaskWithPercentage:(float)percentage andTitle:(NSString *)title;
[SVHTTPRequest POST:URL parameters:@{} progress:^(float progress) {[self.navigationController setSGProgressPercentage:progress * 100];} completion:^(id response, NSHTTPURLResponse *urlResponse, NSError *error) {}];
MIT 许可证