Giter Site home page Giter Site logo

rakutou / hkcircularprogressview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harmek/hkcircularprogressview

0.0 1.0 0.0 884 KB

A simple discrete/continuous circular progress view with current/max properties, customizable appearance and animatable.

License: BSD 2-Clause "Simplified" License

Ruby 1.49% Objective-C 98.51%

hkcircularprogressview's Introduction

HKCircularProgressView

Screenshot

HKCircularProgressView is a simple discrete/continuous circular progress view with current/max properties, customizable appearance and animatable.

How to use it

  1. Use CocoaPods by adding pod 'HKCircularProgressView' in your Podfile.
  2. Manually:
  • Clone this repository
  • Copy HKCircularProgressView and HKCircularProgressLayer files (.h and .m) into your project.
  • #import "HKCircularProgressView" and add the view as a subview (you can also do this from a .xib file).

How to configure it

The main properties are:

  • Max: the maximum value.
  • Current: the current value (the progress will be current/max).
  • Step: if 0 then it will be a continuous progress view. If not, it will be a discrete progress view with (max/step) markers.

You can also configure the appearance of the view (also accessible through [HKCircularProgressView appearance]):

  • progressTintColor: the color of the progression.
  • trackTintColor: the color of the track (which is the part that is not yet completed).
  • animationDuration: the duration of the animations.
  • fillRadius: the amount of the circle that is filled. 1 draws a full circle, 0.5 draws half a circle (a ring), 0.25 a quarter, etc.
  • startAngle: the angle, in radius, where the progression begins.
  • drawFullTrack: indicates whether the track is fully drawn or not. YES will always draw a full circle of 'trackColor' color.
  • outlineWidth: if 0 (by default), does nothing. If > 0 draws outlines for non-completed progress parts.
  • outlineColor: color of the outlines, set to progressTintColor by default.
  • endPoint: specifies how the progress' end-points (start and end) will be drawn. Default is flat ( HKCircularProgressEndPointFlat ) but the project contains 2 other built-in end-points: HKCircularProgressEndPointRound and HKCircularProgressEndPointSpike. The screenshot above shows all those 3 examples. You can create your own end-point by using the HKCircularProgressEndPointDrawer protocol.

If you want to use a HKCircularProgressView as a substitute for UIActivityIndicator, you can use the following methods to start/stop an animation that rotates the view clockwise:

  • startAnimating.
  • stopAnimating.

hkcircularprogressview's People

Contributors

harmek avatar diegoalfarov avatar

Watchers

Harimoto 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.