A custom meter view wich displays information with two half rounds using Core graphics framework. HalfRoundsMeterView inherits from UIView and exposes all its properties and method.
Add HalfRoundsMeterView.h and HalfRoundsMeterView.m to your projet.
Specifies the current value of the meter.
Specifies the maximum value of the meter
To change the color of the round which represents the maximum value.
To change the color of the round which represents the current value.
#import "HalfRoundsMeterView.h"
//Some code
- (void)viewDidLoad {
[super viewDidLoad];
//Creates the view
HalfRoundsMeterView *circleView = [[HalfRoundsMeterView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)];
//Set the current and maximum values
circleView.currentValue = 100;
circleView.maximumValue = 200;
//Customizes the colors
circleView.currentValueColor = [UIColor colorWithRed:0.039 green:0.729 blue:0.71 alpha:1];
circleView.maximumValueColor = [UIColor blueColor];
//Add to the content view
[self.view addSubview:circleView];
}