Latest 1.0.1
Homepage https://github.com/TLOpenSpring/TLProgressSpring
License MIT
Platforms ios 8.0
Authors

<<<<<<< HEAD

CI Status
Version
License
Platform

示例图片

1

2

3

4

5

6

7

8

9

10

11

12

How to use

  1. 导航栏的进度条用法:

首先导入类库
#import <TLProgressSpring/TLNavBarProgressView.h>

键入代码:

 TLNavBarProgressView *progressView = [TLNavBarProgressView progressViewforNavigationController:self.navigationController];
    progressView.progressTintColor=[UIColor redColor];

    _progress+= 0.2;

    if(_progress>=1){
        _progress=0;
    }

    [progressView setProgress:_progress animated:YES];
  1. 自定义转轮的用法

导入类库
#import <TLProgressSpring/TLActivityIndicatorView.h>

 _activityIndicatorView = [[TLActivityIndicatorView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
    [self.view addSubview:_activityIndicatorView];
    _activityIndicatorView.animatorDuration = 0.8;
    [_activityIndicatorView startAnimating];

 启动:

 -(void)showActivity:(id)sender{
    if(_activityIndicatorView){
        [_activityIndicatorView startAnimating];
    }
}
  1. 带有遮罩效果的各种进度条使用

导入类库
#import <TLProgressSpring/TLOverlayProgressView.h>

首先利用Block定义一个延时关闭的方法:

- (void)performBlock:(void(^)())block afterDelay:(NSTimeInterval)delay {
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), block);
}
  • 默认转轮进度条用法
-(void)onShowProgress0{
    TLOverlayProgressView *overLayProgress = [TLOverlayProgressView
                                              showOverlayAddTo:[self rootView]
                                              title:nil
                                              style:TLOverlayStyleIndeterminate
                                              animated:YES stopBlock:^(TLOverlayProgressView *progressView) {

                                                  [progressView hideAnimated:YES];
                                              }];
    [overLayProgress showAnimated:YES];
    [self performBlock:^{
        [overLayProgress dismiss:YES];
    } afterDelay:2.0];
}
  • 显示失败的图标

-(void)onShowProgress1{
    TLOverlayProgressView *overlayProgress=[TLOverlayProgressView showOverlayAddTo:[self rootView] title:@"Failier" style:TLOverlayStyleCrossIcon animated:YES stopBlock:^(TLOverlayProgressView *progressView) {
        [progressView hideAnimated:YES];
    }];

    [overlayProgress showAnimated:YES];
    [self performBlock:^{
        [overlayProgress dismiss:YES];
    } afterDelay:2.0];

}
  • 显示成功的图标
-(void)onShowProgress2{
    TLOverlayProgressView *overlayProgress=[TLOverlayProgressView showOverlayAddTo:[self rootView] title:@"Success" style:TLOverlayStyleCheckmarkIcon animated:YES stopBlock:^(TLOverlayProgressView *progressView) {
        [progressView hideAnimated:YES];
    }];

    [overlayProgress showAnimated:YES];
    [self performBlock:^{
        [overlayProgress dismiss:YES];
    } afterDelay:2.0];

}
  • 显示百分比的水平方向的进度条
-(void)onShowProgress3{
    TLOverlayProgressView *overLayProgress = [TLOverlayProgressView
                                              showOverlayAddTo:self.view
                                              title:@"loading"
                                              style:TLOverlayStyleHorizontalBar
                                              animated:YES];
    overLayProgress.isShowPercent=YES;
    [overLayProgress showAnimated:YES];
    [self simulateProgress:overLayProgress];

}
  • 显示小图标的进度条
-(void)onShowProgress4:(TLOverlayStyle )style{
    TLOverlayProgressView *progress = [TLOverlayProgressView showOverlayAddTo:self.view
                                                                        title:@"loading..."
                                                                        style:TLOverlayStyleIndeterminateSmall
                                                                     animated:YES stopBlock:^(TLOverlayProgressView *progressView) {

                                                                         [progressView dismiss:YES];
                                                                     }];
    [self performBlock:^{
        [progress dismiss:YES];
    } afterDelay:2.0];
}
  • 显示圆环进度条
-(void)onShowProgress5{
    TLOverlayProgressView *overlayProgressView =[TLOverlayProgressView showOverlayAddTo:[self rootView] title:@"" style:TLOverlayStyleDeterminateCircular animated:YES stopBlock:^(TLOverlayProgressView *progressView) {
        [progressView hideAnimated:YES];
    }];
    [overlayProgressView showAnimated:YES];

    [self simulateProgress:overlayProgressView];
}
  • 显示苹果系统自带的ActivityIndicator
-(void)onShowProgress7{
    TLOverlayProgressView *overLayProgress = [TLOverlayProgressView
                                              showOverlayAddTo:self.view
                                              title:@"Loading..."
                                              style:TLOverlayStyleSystemUIActivity
                                              animated:YES stopBlock:^(TLOverlayProgressView *progressView) {
                                                  [progressView hideAnimated:YES];
                                              }];
    [overLayProgress showAnimated:YES];
    [self performBlock:^{
        [overLayProgress dismiss:YES];
    } afterDelay:2.0];
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

TLProgressSpring is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "TLProgressSpring"

Author

Andrew, [email protected]

License

TLProgressSpring is available under the MIT license. See the LICENSE file for more info.

一款进度条工具类,可以在导航栏上显示,也可以弹出一个转轮显示,用户随时可交互

e7a0f294260c4687ab69a6d47ec40498dcee80bc

Latest podspec

{
    "name": "TLProgressSpring",
    "version": "1.0.1",
    "summary": "u4e00u6b3eu8fdbu5ea6u6761u5de5u5177u7c7buff0cu53efu4ee5u5728u5bfcu822au680fu4e0au663eu793auff0cu4e5fu53efu4ee5u5f39u51fau4e00u4e2au8f6cu8f6eu663eu793auff0cu7528u6237u968fu65f6u53efu4ea4u4e92",
    "description": ""u8fdbu5ea6u6761u63d0u793au6846u5de5u5177uff0cAPIu7b80u5355u6613u7528uff0cu53efu4ee5u5728u5bfcu822au680fu4e0au663eu793auff0cu4e5fu53efu4ee5u5f39u51fau4e00u4e2au8f6cu8f6eu6765u663eu793auff0cu652fu6301u70b9u51fbu5173u95eduff1bu652fu6301u663eu793au767eu5206u6bd4uff0cu52a8u753bu6548u679cu7b80u5355u4f18u96c5"",
    "homepage": "https://github.com/TLOpenSpring/TLProgressSpring",
    "license": "MIT",
    "authors": {
        "Andrew": "[email protected]"
    },
    "source": {
        "git": "https://github.com/TLOpenSpring/TLProgressSpring.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "TLProgressSpring/Classes/**/*"
}

Pin It on Pinterest

Share This