| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- //
- // UIView+Additions.m
- // kneet2
- //
- // Created by Jason Lee on 10/2/15.
- // Copyright © 2015 ntels. All rights reserved.
- //
- #import "UIView+Additions.h"
- @implementation UIView (Additions)
- - (CGFloat)x {
- return self.frame.origin.x;
- }
- - (void)setX:(CGFloat)x {
- CGRect selfRect = self.frame;
- selfRect.origin.x = x;
- self.frame = selfRect;
- }
- - (CGFloat)y {
- return self.frame.origin.y;
- }
- - (void)setY:(CGFloat)y {
- CGRect selfRect = self.frame;
- selfRect.origin.y = y;
- self.frame = selfRect;
- }
- - (CGFloat)width {
- return self.frame.size.width;
- }
- - (void)setWidth:(CGFloat)width {
- CGRect selfRect = self.frame;
- selfRect.size.width = width;
- self.frame = selfRect;
- }
- - (CGFloat)height {
- return self.frame.size.height;
- }
- - (void)setHeight:(CGFloat)height {
- CGRect selfRect = self.frame;
- selfRect.size.height = height;
- self.frame = selfRect;
- }
- @end
|