Skip to content

Instantly share code, notes, and snippets.

@shaps80
Created February 19, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save shaps80/6c6ee46457e3c854daf848013aa5a503 to your computer and use it in GitHub Desktop.
Save shaps80/6c6ee46457e3c854daf848013aa5a503 to your computer and use it in GitHub Desktop.
Provides a CGAffineTransform suitable for flipping the Y Axis.
private func flipped(size: CGSize) -> CGAffineTransform {
let mirror = CGAffineTransform(scaleX: 1, y: -1)
let translate = CGAffineTransform(translationX: 0, y: size.height)
return mirror.concatenating(translate)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment