Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Last active December 27, 2020 23:06
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 sturdysturge/f945625ffc599afee1bcb104f540f3f3 to your computer and use it in GitHub Desktop.
Save sturdysturge/f945625ffc599afee1bcb104f540f3f3 to your computer and use it in GitHub Desktop.
backgroundColor
extension View {
func backgroundColor(_ color: Color) -> some View {
return self.background(color)
}
}
struct ContentView: View {
var body: some View {
Rectangle()
.backgroundColor(.blue)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment