-
Notifications
You must be signed in to change notification settings - Fork 8
/
UIView+SDExtension.m
executable file
·77 lines (59 loc) · 1.38 KB
/
UIView+SDExtension.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
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// UIView+SDExtension.m
// SDRefreshView
//
// Created by aier on 15-2-23.
// Copyright (c) 2015年 GSD. All rights reserved.
//
/**
*******************************************************
* *
* 感谢您的支持, 如果下载的代码在使用过程中出现BUG或者其他问题 *
* 您可以发邮件到[email protected] 或者 到 *
* https://github.com/gsdios?tab=repositories 提交问题 *
* *
*******************************************************
*/
#import "UIView+SDExtension.h"
@implementation UIView (SDExtension)
- (CGFloat)sd_height
{
return self.frame.size.height;
}
- (void)setSd_height:(CGFloat)sd_height
{
CGRect temp = self.frame;
temp.size.height = sd_height;
self.frame = temp;
}
- (CGFloat)sd_width
{
return self.frame.size.width;
}
- (void)setSd_width:(CGFloat)sd_width
{
CGRect temp = self.frame;
temp.size.width = sd_width;
self.frame = temp;
}
- (CGFloat)sd_y
{
return self.frame.origin.y;
}
- (void)setSd_y:(CGFloat)sd_y
{
CGRect temp = self.frame;
temp.origin.y = sd_y;
self.frame = temp;
}
- (CGFloat)sd_x
{
return self.frame.origin.x;
}
- (void)setSd_x:(CGFloat)sd_x
{
CGRect temp = self.frame;
temp.origin.x = sd_x;
self.frame = temp;
}
@end