]> git.saurik.com Git - apple/security.git/blob - Keychain/CircleStatusView.m
Security-57031.1.35.tar.gz
[apple/security.git] / Keychain / CircleStatusView.m
1 //
2 // CircleStatusView.m
3 // Security
4 //
5 // Created by John Hurley on 12/5/12.
6 //
7 //
8
9 #import "CircleStatusView.h"
10
11 @implementation CircleStatusView
12
13 - (id)initWithFrame:(CGRect)frame
14 {
15 self = [super initWithFrame:frame];
16 if (self) {
17 _color = [UIColor redColor];
18 // NSLog(@"Frame: w: %f, h: %f", self.frame.size.width, self.frame.size.height);
19 }
20 return self;
21 }
22
23 /*
24 // Only override drawRect: if you perform custom drawing.
25 // An empty implementation adversely affects performance during animation.
26 - (void)drawRect:(CGRect)rect
27 {
28 // Drawing code
29 }
30 */
31
32 - (void)drawRect:(CGRect)rect
33 {
34 CGContextRef context= UIGraphicsGetCurrentContext();
35
36 // NSLog(@"Frame: w: %f, h: %f", self.frame.size.width, self.frame.size.height);
37 if (!_color)
38 _color= [UIColor redColor];
39 CGContextSetFillColorWithColor(context, _color.CGColor);
40 CGContextSetAlpha(context, 0.95);
41 CGContextFillEllipseInRect(context, CGRectMake(0,0,self.frame.size.width,self.frame.size.height));
42
43 CGContextSetStrokeColorWithColor(context, _color.CGColor);
44 CGContextStrokeEllipseInRect(context, CGRectMake(0,0,self.frame.size.width,self.frame.size.height));
45 }
46
47 @end
48
49 @implementation ItemStatusView
50
51 - (id)initWithFrame:(CGRect)frame
52 {
53 self = [super initWithFrame:frame];
54 if (self) {
55 _color = [UIColor blueColor];
56 }
57 return self;
58 }
59
60 - (void)drawRect:(CGRect)rect
61 {
62 CGContextRef context= UIGraphicsGetCurrentContext();
63
64 // NSLog(@"Frame: w: %f, h: %f", self.frame.size.width, self.frame.size.height);
65 if (!_color)
66 _color= [UIColor blueColor];
67 CGContextSetFillColorWithColor(context, _color.CGColor);
68 CGContextSetAlpha(context, 0.95);
69 CGContextFillEllipseInRect(context, CGRectMake(0,0,self.frame.size.width,self.frame.size.height));
70
71 CGContextSetStrokeColorWithColor(context, _color.CGColor);
72 CGContextStrokeEllipseInRect(context, CGRectMake(0,0,self.frame.size.width,self.frame.size.height));
73 }
74
75 @end