Created
January 17, 2015 00:14
-
-
Save rakuishi/a893db316969da025ce6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIView+EasyRectMake.m | |
// | |
// Created by OCHIISHI Koichiro on 2012/10/25. | |
// | |
// | |
#import "UIView+EasyRectMake.h" | |
@implementation UIView (EasyRectMake) | |
- (CGFloat)originX | |
{ | |
return self.frame.origin.x; | |
} | |
- (void)setOriginX:(CGFloat)originX | |
{ | |
self.frame = CGRectMake(originX, self.frame.origin.y, self.frame.size.width, self.frame.size.height); | |
} | |
- (CGFloat)originY | |
{ | |
return self.frame.origin.y; | |
} | |
- (void)setOriginY:(CGFloat)originY | |
{ | |
self.frame = CGRectMake(self.frame.origin.x, originY, self.frame.size.width, self.frame.size.height); | |
} | |
- (CGFloat)sizeWidth | |
{ | |
return self.frame.size.width; | |
} | |
- (void)setSizeWidth:(CGFloat)sizeWidth | |
{ | |
self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, sizeWidth, self.frame.size.height); | |
} | |
- (CGFloat)sizeHeight | |
{ | |
return self.frame.size.height; | |
} | |
- (void)setSizeHeight:(CGFloat)sizeHeight | |
{ | |
self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, sizeHeight); | |
} | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIView+EasyRectMake.h | |
// | |
// Created by OCHIISHI Koichiro on 2012/10/25. | |
// | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIView (EasyRectMake) | |
@property (assign, nonatomic) CGFloat originX; | |
@property (assign, nonatomic) CGFloat originY; | |
@property (assign, nonatomic) CGFloat sizeWidth; | |
@property (assign, nonatomic) CGFloat sizeHeight; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment