Created
October 28, 2016 06:29
-
-
Save dfelber/c259fb7c7d3eb4ba8fd153a2a983acde to your computer and use it in GitHub Desktop.
Swift extension for CGRect to return the center as a CGPoint.
This file contains hidden or 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
extension CGRect { | |
var center: CGPoint { | |
return CGPoint(x: midX, y: midY) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment