-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCALDayCircleView.m
37 lines (33 loc) · 1.26 KB
/
CALDayCircleView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// CALMonthCircleView.m
// iOS Tester
//
// Created by Austin Cherry on 5/9/14.
// Copyright (c) 2014 Vluxe. All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////////////////////////
#import "CALDayCircleView.h"
@implementation CALDayCircleView
////////////////////////////////////////////////////////////////////////////////////////////////////
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor clearColor];
self.padding = 10;
}
return self;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
- (void)drawRect:(CGRect)rect
{
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGPathRef path = [UIBezierPath bezierPathWithOvalInRect:CGRectInset(self.bounds, self.padding, self.padding)].CGPath;
CGContextAddPath(ctx, path);
CGContextClip(ctx);
CGContextSetFillColorWithColor(ctx, self.color.CGColor);
CGContextFillRect(ctx, self.bounds);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@end