This iOS UI element provides a customizable gauge, you can customize size, color, thickness and many other cool things.
Project tested under iOS 5.x and 6.x, requires ARC
- Copy LDGauges.h/.m, LDGaugesLayer.h/.m in your project
- Include QuarzCore.framework and CoreGraphics.framework
Init gauges in a frame with start angle, radius and thickness
LDGauge gauge = [[LDGauges alloc]initWithFrame:CGRectMake(30, 0, 250, 250)
startAngle:0
gaugesRadius:100
gaugesThickness:5];
Set gauge color
[gauge setGaugeColor:[UIColor colorWithRed:209/255.0f green:210/255.0f blue:204/255.0f alpha:1.0]];
Set gauge background color
[gauge setGaugeBackgroundColor:[UIColor colorWithRed:56/255.0f green:184/255.0f blue:154/255.0f alpha:1.0]];
Add gauge to the main view
[self.view addSubview:gauge];
This method requires a percentage value, (changing value, it triggers the component animation automatically)
[gauges setGaugesRate:30];
[gauge setFont:[UIFont fontWithName:@"Helvetica" size:40]];
[gauge setFontColor:[UIColor blackColor]];
Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0