Code Monkey home page Code Monkey logo

objective-c_ckcirculardial's Introduction

#Set it and forget it circle widget

circle image

This circle widget, build with some UIViews, UIPanGestureRecognizer and minimal Quartz utility is easy to use. Set a min and max number as well as desired arameters for the arc, circle, and background circle you want to draw. Finally, you can adjust the font and color of the measuring number and also attach an NSString to it to indicate units.

Here's an example setup:

    self.dialView = [[CKCircleView alloc] initWithFrame:CGRectMake((width - 200)/2, 100, 200, 200)];
    self.dialView.arcColor = [UIColor whiteColor];
    self.dialView.backColor = [UIColor lightGrayColor];
    self.dialView.dialColor = [UIColor whiteColor];
    self.dialView.arcRadius = 80;
    self.dialView.units = @"hours";
    self.dialView.minNum = 2;
    self.dialView.maxNum = 10;
    self.dialView.labelColor = [UIColor whiteColor];
    self.dialView.labelFont = [UIFont systemFontOfSize:20.0];
    [self.view addSubview: self.dialView];

Defaults are in place for all public properties.

To-do list:

1. Make opacity of each element adjustable
2. Make CKCircleView contain a background circle rather than be the background circle so arcRadius has more flexibility
3. Move inner label to its own class and use KVO to update label info

objective-c_ckcirculardial's People

Contributors

sunnysideprodcorp avatar

Watchers

James Cloos avatar Vipin Saini 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.