Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added a few more short getters/setters (view right position and size)

  • Loading branch information...
commit b1dc3278d1d542f38f7a2e07c3dbeef5bd79d127 1 parent 6d7a5cc
@ettore authored
Showing with 32 additions and 0 deletions.
  1. +11 −0 categories/UIViewCategory.h
  2. +21 −0 categories/UIViewCategory.m
View
11 categories/UIViewCategory.h
@@ -47,6 +47,17 @@
-(void)setW:(CGFloat)w;
-(CGFloat)h;
-(void)setH:(CGFloat)h;
+
+/*! The ordinate position below this view, i.e. Y + Height. */
-(CGFloat)low;
+/*! The abscissa position at the right of this view, i.e. X + Width. */
+-(CGFloat)r;
+
+/*! @return The view size. */
+-(CGSize)sz;
+
+/*! Set view size leaving origin unchanged. */
+-(void)setSz:(CGSize)size;
+
@end
View
21 categories/UIViewCategory.m
@@ -122,6 +122,13 @@ -(void)setH:(CGFloat)h
}
+-(CGFloat)r
+{
+ CGRect r = [self frame];
+ return r.origin.x + r.size.width;
+}
+
+
-(CGFloat)low
{
CGRect r = [self frame];
@@ -129,6 +136,20 @@ -(CGFloat)low
}
+- (CGSize)sz
+{
+ return [self frame].size;
+}
+
+
+- (void)setSz:(CGSize)size
+{
+ CGRect frame = [self frame];
+ frame.size = size;
+ [self setFrame:frame];
+}
+
+
- (UIView *)findFirstResponder
{
if (self.isFirstResponder) {
Please sign in to comment.
Something went wrong with that request. Please try again.