Skip to content

Instantly share code, notes, and snippets.

@damodarnamala
Forked from shaps80/Flipped.swift
Created September 16, 2022 04:25
Show Gist options
  • Save damodarnamala/d110f59b1c111acb27bcfd4d5ba12919 to your computer and use it in GitHub Desktop.
Save damodarnamala/d110f59b1c111acb27bcfd4d5ba12919 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