Skip to content

Instantly share code, notes, and snippets.

@zrxq
Last active February 3, 2016 15:35
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