Skip to content

Instantly share code, notes, and snippets.

@psobko
Created November 3, 2013 16:59
Show Gist options
  • Save psobko/7292302 to your computer and use it in GitHub Desktop.
Save psobko/7292302 to your computer and use it in GitHub Desktop.
CGRect frame = [self.view frame];
CGPoint topLeft = CGPointMake(CGRectGetMinX(frame), CGRectGetMinY(frame));
CGPoint topRight = CGPointMake(CGRectGetMaxX(frame), CGRectGetMinY(frame));
CGPoint bottomLeft = CGPointMake(CGRectGetMinX(frame), CGRectGetMaxY(frame));
CGPoint bottomRight = CGPointMake(CGRectGetMaxX(frame), CGRectGetMaxY(frame));
//If you need those coordinates in a particular view, the first line should be something like
CGRect frame = [self.view convertRect:[self.view bounds] toView:someOtherView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment