-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayView.m
37 lines (29 loc) · 875 Bytes
/
PlayView.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
//
// PlayView.m
// SpotifyRunningApp
//
// Created by Albert Örwall on 05/08/14.
// Copyright (c) 2014 Albert Örwall. All rights reserved.
//
#import "PlayView.h"
@implementation PlayView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
-(void)drawRect:(CGRect)rect
{
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextBeginPath(ctx);
CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); // top left
CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMidY(rect)); // mid right
CGContextAddLineToPoint(ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // bottom left
CGContextClosePath(ctx);
CGContextSetRGBFillColor(ctx, 224.0/255.0, 0, 112.0/255.0, 1);
CGContextFillPath(ctx);
}
@end