-
-
Save sturdysturge/2f6a6c6646a7d08ccd32436a1e4285cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension View { | |
| // foregroundColor(_ colour: _ColorLiteralType) also works but Apple rejects | |
| // undocumented types that start with an underscore from App Store approval | |
| func foregroundColor(_ colour: UIColor) -> some View { | |
| self.foregroundColor(Color(uiColor: colour)) | |
| } | |
| } | |
| struct ContentView: View { | |
| var body: some View { | |
| Text("Text") | |
| .font(.largeTitle) | |
| .foregroundColor(#colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment