Skip to content

Instantly share code, notes, and snippets.

@nathanborror
Created January 29, 2021 02:09
Show Gist options
  • Save nathanborror/30a6a593ebba33b1d0cd246b3639fbf2 to your computer and use it in GitHub Desktop.
Save nathanborror/30a6a593ebba33b1d0cd246b3639fbf2 to your computer and use it in GitHub Desktop.
struct FlippedUpsideDown: ViewModifier {
func body(content: Content) -> some View {
content
.rotationEffect(.radians(.pi))
.scaleEffect(x: -1, y: 1, anchor: .center)
}
}
extension View {
func flipUpsideDown() -> some View {
self.modifier(FlippedUpsideDown())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment