Giter VIP home page Giter VIP logo

sfroundprogresscounterview's Introduction

SFRoundProgressCounterView

A custom UIView with a rounded progress bar and a counter in the center of the circle. Supports multiple time intervals (in milliseconds), start/stop/resuming counter, set custom color, etc. (see example project)

Alt text Alt text

Setup

Installing with CocoaPods

If you're unfamiliar with CocoaPods you can check out this tutorial here.

  1. In Terminal navigate to the root of your project.

  2. Run 'touch Podfile' to create the Podfile.

  3. Open the Podfile using 'open -e Podfile'

  4. Add the pod SFRoundProgressCounterView to your Podfile.

     platform :ios, '7.0'
     pod 'SFRoundProgressCounterView'
    
  5. Run pod install.

  6. Open your app's .xcworkspace file to launch Xcode and start using the control!

Usage

  1. Either create SFRoundProgressCounterView by dragging UIView from storyboard and change implementing class or create it programmatically

  2. Create an outlet (if create via storyboard)

  3. Set up time intervals

     self.sfProgressCounterView.delegate = self;
     NSNumber* interval = [NSNumber numberWithLong:5000.0];
     self.sfProgressCounterView.intervals = @[interval];
     // you could also define multiple intervals
     //self.sfProgressCounterView.intervals = @[interval, interval, interval];
    
  4. Counter interaction

     [self.sfProgressCounterView start];
     [self.sfProgressCounterView stop];
     [self.sfProgressCounterView resume];
     [self.sfProgressCounterView reset];
    
  5. Appearance Settings

     // thickness of outer circle
     self.sfProgressCounterView.outerCircleThickness = [NSNumber numberWithFloat:3.0];
    
     // thickness of inner circle
     self.sfProgressCounterView.innerCircleThickness = [NSNumber numberWithFloat:1.0];
    
     // track color of outer circle
     self.sfProgressCounterView.innerTrackColor = [UIColor redColor];
     
     // track color of inner circle
     self.sfProgressCounterView.outerTrackColor = [UIColor blackColor];
    
     // distance between two circles (if multiple intervals)
     self.sfProgressCounterView.circleDistance = [NSNumber numberWithFloat:6.0]; 
    
     // set color of outer progress circles
     self.sfProgressCounterView.outerProgressColor = color;
    
     // set color of inner progress circle
     self.sfProgressCounterView.innerProgressColor = color;
     
     // set color of counter label
     self.sfProgressCounterView.labelColor = color;
    
     // hide fraction 
     self.sfProgressCounterView.hideFraction = YES;
    

Delegate Methods

    - (void)countdownDidEnd:(SFRoundProgressCounterView*)progressCounterView;
    - (void)intervalDidEnd:(SFRoundProgressCounterView*)progressCounterView WithIntervalPosition:(int)position;
    - (void)counter:(SFRoundProgressCounterView *)progressCounterView didReachValue:(unsigned long long)value;

Author(s)

Simpliflow GmbH

Thomas Winkler

Licence

Distributed under the MIT License.

Attributation

TTCounterLabel

CERoundProgressView

sfroundprogresscounterview's People

Contributors

anka avatar

Watchers

James Cloos avatar gryphon avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.