Skip to content

Commit

Permalink
namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Mazzon authored and Fernando Mazzon committed Jan 21, 2013
1 parent 9a882f1 commit 328b2a9
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 28 deletions.
20 changes: 10 additions & 10 deletions Classes/UIView+FrameHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

@interface UIView (FrameHelpers)

@property (nonatomic) CGFloat frameX_oui;
@property (nonatomic) CGFloat frameY_oui;
@property (nonatomic) CGFloat frameWidth_oui;
@property (nonatomic) CGFloat frameHeight_oui;
@property (nonatomic) CGFloat frameX_rga;
@property (nonatomic) CGFloat frameY_rga;
@property (nonatomic) CGFloat frameWidth_rga;
@property (nonatomic) CGFloat frameHeight_rga;

@property (nonatomic) CGSize frameSize_oui;
@property (nonatomic) CGPoint frameOrigin_oui;
@property (nonatomic) CGSize frameSize_rga;
@property (nonatomic) CGPoint frameOrigin_rga;

@property (nonatomic) CGFloat centerX_oui;
@property (nonatomic) CGFloat centerY_oui;
@property (nonatomic) CGFloat centerX_rga;
@property (nonatomic) CGFloat centerY_rga;

@property (nonatomic, readonly) CGFloat frameMaxX_oui;
@property (nonatomic, readonly) CGFloat frameMaxY_oui;
@property (nonatomic, readonly) CGFloat frameMaxX_rga;
@property (nonatomic, readonly) CGFloat frameMaxY_rga;

@end
73 changes: 55 additions & 18 deletions Classes/UIView+FrameHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,104 @@

@implementation UIView (FrameHelpers)

- (CGFloat)frameX_oui { return self.frame.origin.x; }
- (CGFloat)frameY_oui { return self.frame.origin.y; }
- (CGFloat)frameWidth_oui { return self.frame.size.width; }
- (CGFloat)frameHeight_oui { return self.frame.size.height; }
- (CGSize)frameSize_oui { return self.frame.size; }
- (CGPoint)frameOrigin_oui { return self.frame.origin; }
- (CGFloat)frameX_rga
{
return self.frame.origin.x;
}

- (CGFloat)frameY_rga
{
return self.frame.origin.y;
}

- (CGFloat)frameWidth_rga
{
return self.frame.size.width;
}

- (CGFloat)frameHeight_rga
{
return self.frame.size.height;
}

- (CGSize)frameSize_rga
{
return self.frame.size;
}

-(void)setFrameX_oui:(CGFloat)x
- (CGPoint)frameOrigin_rga
{
return self.frame.origin;
}

- (void)setFrameX_rga:(CGFloat)x
{
CGRect rect = self.frame;
rect.origin.x = x;
self.frame = rect;
}

-(void)setFrameY_oui:(CGFloat)y
- (void)setFrameY_rga:(CGFloat)y
{
CGRect rect = self.frame;
rect.origin.y = y;
self.frame = rect;
}

-(void)setFrameWidth_oui:(CGFloat)width
- (void)setFrameWidth_rga:(CGFloat)width
{
CGRect rect = self.frame;
rect.size.width = width;
self.frame = rect;
}

-(void)setFrameHeight_oui:(CGFloat)height
- (void)setFrameHeight_rga:(CGFloat)height
{
CGRect rect = self.frame;
rect.size.height = height;
self.frame = rect;
}

-(void)setFrameSize_oui:(CGSize)size
- (void)setFrameSize_rga:(CGSize)size
{
CGRect rect = self.frame;
rect.size = size;
self.frame = rect;
}

-(void)setFrameOrigin_oui:(CGPoint)origin
- (void)setFrameOrigin_rga:(CGPoint)origin
{
CGRect rect = self.frame;
rect.origin = origin;
self.frame = rect;
}

-(CGFloat)frameMaxX_oui { return CGRectGetMaxX(self.frame); }
-(CGFloat)frameMaxY_oui { return CGRectGetMaxY(self.frame); }
- (CGFloat)frameMaxX_rga
{
return CGRectGetMaxX(self.frame);
}

-(CGFloat)centerX_oui { return self.center.x; }
-(CGFloat)centerY_oui { return self.center.y; }
- (CGFloat)frameMaxY_rga
{
return CGRectGetMaxY(self.frame);
}

- (CGFloat)centerX_rga
{
return self.center.x;
}

- (CGFloat)centerY_rga
{
return self.center.y;
}

-(void)setCenterX_oui:(CGFloat)centerX
- (void)setCenterX_rga:(CGFloat)centerX
{
self.center = CGPointMake(centerX, self.center.y);
}

-(void)setCenterY_oui:(CGFloat)centerY
- (void)setCenterY_rga:(CGFloat)centerY
{
self.center = CGPointMake(self.center.x, centerY);
}
Expand Down

0 comments on commit 328b2a9

Please sign in to comment.