Skip to content

Instantly share code, notes, and snippets.

@ha1f
Created July 29, 2020 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ha1f/d039eebdd0ee14732b7009ab829b0398 to your computer and use it in GitHub Desktop.
Save ha1f/d039eebdd0ee14732b7009ab829b0398 to your computer and use it in GitHub Desktop.
extension CGPoint {
func map(_ transform: (CGFloat) -> CGFloat) -> CGPoint {
CGPoint(x: transform(x), y: transform(y))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment