Creates a ImageView with a circle and text that is displaying the persentage
Its fully tested on iOS 7.
###All you have to do:
#####1. Import the file in your class:
#import "UIImageView+PersentageCircle.h"
#####2. To show the circle on the right side of your UITableViewCell add the following to - tableView: cellForRowAtIndexPath:
:
UIImageView *view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 60)];
cell.accessoryView = [view applyCircleWithPersentage:<#yourOwnPersentage#> andTintColor:[UIColor orangeColor];
#####3. Or for the left side of the cell:
UIImageView *view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 60)];
[view applyCircleWithPersentage:<#yourOwnPersentage#> andTintColor:[UIColor orangeColor];
cell.imageView.image = view.image;
#####4. The last step is to change the height of the cells with:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 60.0f;
}
#####5. Now you can customise the circle in UIImageView+PersentageCircle.m
.
And now you should have your own percentage circle!
A german tutorial is availabe on my blog: FudgeCode.de