Created
February 7, 2014 17:44
-
-
Save psobko/8867811 to your computer and use it in GitHub Desktop.
Get the center of a CGRect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGPoint (^CGRectGetCenter)(CGRect) = ^(CGRect rect) | |
{ | |
return CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Swift 5 version: