Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Last active Dec 27, 2020
Embed
What would you like to do?
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