Including All of the UIColors in SwiftUI.Color

I wrote a simple little extension to make all of the pre-defined colors in UIColor available in SwiftUI.Color. I wanted this mainly to get the new "adaptable colors" that support dark mode into SwiftUI. For example, with this extension you can write Text("Hello").foregroundColor(.label) instead of Text("Hello").foregroundColor(Color(UIColor.label))

Here's the gist.

Previous
Previous

Swatches is on the App Store!

Next
Next

iOS 13, Unit Tests, and Mocking a SceneDelegate