-
Notifications
You must be signed in to change notification settings - Fork 11
/
UIKit+HeroExamples.m
64 lines (49 loc) · 1.4 KB
/
UIKit+HeroExamples.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// UIKit+HeroExamples.m
// Hero-ObjectiveC
//
// Created by luca.li on 2017/1/22.
// Copyright © 2017年 luca. All rights reserved.
//
#import "UIKit+HeroExamples.h"
@implementation UIView (HeroExamples)
- (CGFloat)cornerRadius {
return self.layer.cornerRadius;
}
- (void)setCornerRadius:(CGFloat)cornerRadius {
self.layer.cornerRadius = cornerRadius;
}
- (CGFloat)shadowRadius {
return self.layer.shadowRadius;
}
- (void)setShadowRadius:(CGFloat)shadowRadius {
self.layer.shadowRadius = shadowRadius;
}
- (CGFloat)shadowOpacity {
return self.layer.shadowOpacity;
}
- (void)setShadowOpacity:(CGFloat)shadowOpacity {
self.layer.shadowOpacity = shadowOpacity;
}
- (UIColor *)shadowColor {
return self.layer.shadowColor != nil ? [UIColor colorWithCGColor:self.layer.shadowColor] : nil;
}
- (void)setShadowColor:(UIColor *)shadowColor {
self.layer.shadowColor = shadowColor.CGColor;
}
- (CGSize)shadowOffset {
return self.layer.shadowOffset;
}
- (void)setShadowOffset:(CGSize)shadowOffset {
self.layer.shadowOffset = shadowOffset;
}
- (CGFloat)zPosition {
return self.layer.shadowRadius;
}
- (void)setZPosition:(CGFloat)zPosition {
self.layer.zPosition = zPosition;
}
- (UIViewController *)viewControllerForStoryboardName:(NSString *)storyboardName {
return [UIStoryboard storyboardWithName:storyboardName bundle:nil].instantiateInitialViewController;
}
@end