Open leopic-sc opened 2 years ago
Hi @leopic-sc 🙂
Thanks for bringing this up! We can definitely update the exporter to generate UIKit colors as well. Could you write down some examples of how you'd like to see the other tokens exported in UIKit? That would help a lot!
Is your feature request related to a problem? Please describe. Most mature iOS applications use either fully or partially UIKit for their user interfaces. This means that a purely SwiftUI driven exporter is a nice addition, but has reduced day-to-day value.
Describe the solution you'd like Ideally an entire UIKit driven exporter would be provided by Supernova, but Colors can be a starting point.
Additional context It's important to keep in mind that SwiftUI Colors have an initializer that can take a UIKit UIColor.
Reusing the existing template to generate a UIColor:
Once the color is declared as a UIColor, we can just reference it in SwiftUI:
This would mean that each color would be generated for both Frameworks but still driven from the same token.
The downside of this approach would be newer SwiftUI only applications would have UIKit generated code that wouldn't be used.
NOTE: keep in mind that UIColors can be used to create Colors, but not the other way around.