Skip to content

Instantly share code, notes, and snippets.

@zrxq
Last active February 3, 2016 15:35
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zrxq/5363610 to your computer and use it in GitHub Desktop.
Save zrxq/5363610 to your computer and use it in GitHub Desktop.
CGRect inset with UIEdgeInsets
inline static CGRect CGRectEdgeInset(CGRect rect, UIEdgeInsets insets) {
return CGRectMake(CGRectGetMinX(rect)+insets.left, CGRectGetMinY(rect)+insets.top, CGRectGetWidth(rect)-insets.left-insets.right, CGRectGetHeight(rect)-insets.top-insets.bottom);
}
@tobiasgemperli
Copy link

UIEdgeInsetsInsetRect does the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment