-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardsView.m
More file actions
59 lines (51 loc) · 1.3 KB
/
CardsView.m
File metadata and controls
59 lines (51 loc) · 1.3 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// CardsView.m
// mFinoWallet
//
// Created by Vishwa Deepak on 31/01/16.
// Copyright © 2016 mFino. All rights reserved.
//
#import "CardsView.h"
@implementation CardsView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self commonInit];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
[self commonInit];
}
return self;
}
- (void)commonInit
{
_cornerRadius = 2;
_shadowOffsetWidth = 0;
_shadowOffsetHeight = 3;
_shadowColor = [UIColor blackColor];
_shadowOpacity = 0.5;
}
- (void)layoutSubviews
{
self.layer.cornerRadius = _cornerRadius;
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:_cornerRadius];
self.layer.masksToBounds = false;
self.layer.shadowColor = _shadowColor.CGColor;
self.layer.shadowOffset = CGSizeMake(_shadowOffsetWidth, _shadowOffsetHeight);
self.layer.shadowOpacity = _shadowOpacity;
self.layer.shadowPath = shadowPath.CGPath;
}
@end