Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions FrameAccessor/ViewFrameAccessor.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ - (void)setViewSize:(CGSize)newSize

- (CGFloat)x
{
return self.frame.origin.x;
return CGRectGetMinX(self.frame);
}

- (void)setX:(CGFloat)newX
Expand All @@ -54,7 +54,7 @@ - (void)setX:(CGFloat)newX

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

- (void)setY:(CGFloat)newY
Expand All @@ -69,7 +69,7 @@ - (void)setY:(CGFloat)newY

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

- (void)setHeight:(CGFloat)newHeight
Expand All @@ -81,7 +81,7 @@ - (void)setHeight:(CGFloat)newHeight

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

- (void)setWidth:(CGFloat)newWidth
Expand All @@ -106,7 +106,7 @@ - (void)setLeft:(CGFloat)left

- (CGFloat)right
{
return self.frame.origin.x + self.frame.size.width;
return CGRectGetMaxX(self.frame);
}

- (void)setRight:(CGFloat)right
Expand All @@ -126,7 +126,7 @@ - (void)setTop:(CGFloat)top

- (CGFloat)bottom
{
return self.frame.origin.y + self.frame.size.height;
return CGRectGetMaxY(self.frame);
}

- (void)setBottom:(CGFloat)bottom
Expand Down Expand Up @@ -180,12 +180,12 @@ - (CGPoint)middlePoint

- (CGFloat)middleX
{
return self.width / 2;
return CGRectGetMidX(self.bounds);
}

- (CGFloat)middleY
{
return self.height / 2;
return CGRectGetMidY(self.bounds);
}

@end