Giter VIP home page Giter VIP logo

vaprogresscircle's Introduction

VAProgressCircle


Example Setup

  1. Clone the repo and drag the Classes folder into your project. This should include VAProgressCircle.h/.m, and UIProgressLabel.h/.m
  2. Either create a VAProgressCircle using the - (id)initWithFrame:(CGRect)frame method or drag and drop a UIView into your Interface Builder, subclass it to VAProgressCircle, and link it up to a property in your UIViewController

Here is the snippet of code slightly modified from the example app included in the repo. This shows how to initalize and add a VAProgressChart to your UIViewController using - (id)initWithFrame:(CGRect)frame

self.circleChart = [[VAProgressCircle alloc] initWithFrame:CGRectMake(50, 60, 250, 250)];
[self.view addSubview:self.circleChart];

Documentation


General

  1. VAProgressChart only supports opaque colors at the current release. Using any non-opaque colors could cause unwanted behavior

Methods

- (void)setProgress:(int)progress

The bread and butter method. Takes the current state of the VAProgressCircle and updates the circle to the progress that was passed

- (void)setColor:(UIColor *)color

Sets the color for all the relevant properties of the circle. This includes circleColor, accentLineColor, and numberLabelColor. Also sets the circleHighlightColor by taking the (UIColor *)color and making it 20% lighter

- (void)setTransitionColor:(UIColor * )transitionColor

Sets the transition color for all the relevant properties of the circle. This includes circleTransitionColor, accentLineTransitionColor, and numberLabelTransitionColor. Also sets the circleHighlightTransitionColor by taking the (UIColor *)transitionColor and making it 20% lighter

- (void)setColor:(UIColor * )color withHighlightColor:(UIColor *)highlightColor

Functions similar to - (void)setColor:(UIColor *)color but allows the specification of a highlightColor

- (void)setTransitionColor:(UIColor * )color withHighlightTransitionColor:(UIColor *)highlightColor

Functions similar to - (void)setTransitionColor:(UIColor *)transitionColor but allows the specification of a highlightColor


Properties

VAProgressCircleColorTransitionType transitionType

Should be set to VAProgressCircleColorTransitionTypeGradual if you want the spinner to transition to a second color as it approaches 100%. Defaults to VAProgressCircleColorTransitionTypeNone

VAProgressCircleRotationDirection rotationDirection

Designates which way the progress will rotate around the VAProgressChart. Defaults to VAProgressCircleRotationDirectionCounterClockwise

float animationSpeed

Designates how fast the animation should animate. Defaults to 1.0f

BOOL shouldShowAccentLine

Designates whether or not an accent line should be allocated and animated every time a progress piece reaches the outer circle. Defaults to YES

BOOL shouldShowFinishedAccentCircle

Designates whether or not the VAProgressCircle will create a full accent circle when it reaches 100%. Defaults to YES

BOOL shouldHighlightProgress

Designates whether or not a progress piece will highlight when it reaches the outer circle. Defaults to YES

BOOL shouldNumberLabelTransition

If transitionType is set to VAProgressCircleColorTransitionTypeGradual, shouldNumberLabelTransition specifies if the number label should change color along with the rest of the VAProgressCircle. Defaults to YES

UIColor *circleColor

Designates what color the outer circle should be. Defaults to VADefaultGreen

UIColor *accentLineColor

Designates what color line the VAProgressCircle generates as a progress piece reaches the outer circle. Defaults to VADefaultGreen

UIColor *numberLabelColor

Designates the color of the number label. Defaults to VADefaultGreen

UIColor *circleHighlightColor

Designates the highlight color of the progress pieces if shouldHighlightProgress is set to YES. Defaults to VADefaultGreen

UIColor *circleTransitionColor

Designates what color the outer circle should transition to as it approaches 100%. Defaults to VADefaultBlue

UIColor *accentLineTransitionColor

Designates what color line the VAProgressCircle generates should transition to as it approaches 100%. Defaults to VADefaultBlue

UIColor *numberLabelTransitionColor

Designates the color of the number label should transition to as it approaches 100%. Defaults to VADefaultBlue

UIColor *circleHighlightTransitionColor

Designates the transition highlight color of the progress pieces as the VAProgressCircle approaches 100% if shouldHighlightProgress is set to YES. Defaults to VADefaultBlue

License

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

vaprogresscircle's People

Watchers

 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.