You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when you want to define colors, you need to manually add a file like a Colors.txt to the project and specify that with the SwiftGen Colors command.
Now that Xcode 9 is adding support for named colors within .xcassets SwiftGen should do the same it already does for images now for colors, too: Extract the names of the colors from the assets and add them to the generated Swift file. The assets will probably be the place most iOS developers are going to put there color to anyways, so this feature should be naturally adopted by SwiftGen in my opinion.
The text was updated successfully, but these errors were encountered:
We plan to add that as soon as in the next release 👍
Any help welcome, shouldn't be too much work, just parsing the additional keys in the AssetsCatalogParser and update the templates accordingly
Only thing I'm wondering is if we're gonna have too complicated template variants, e.g. for people wanting to choose some custom output for their images constants but some other custom output for their color constants for the generated code. As all all be in a single template for everything generated from .xcassets, we could end up wth xcassets/flat-swift3.stencil + xcassets/structured-swift3.stencil + xcassets/structuredimages-flatcolors-swift3.stencil + xcassets/flatimages-structuredcolors-swift3.stencil … quite a mess.
I don't think that's gonna be a real problem in practice, as for now we don't have many variants neither for images nor colors (only swift 2/3/4 variants but not flat vs structured), but would be nice if we could make it flexible (using Stencil's {% include %} tags maybe to split that template in 2 ? But is this really worth it? Open to discussion)
Currently when you want to define colors, you need to manually add a file like a
Colors.txt
to the project and specify that with the SwiftGen Colors command.Now that Xcode 9 is adding support for named colors within
.xcassets
SwiftGen should do the same it already does for images now for colors, too: Extract the names of the colors from the assets and add them to the generated Swift file. The assets will probably be the place most iOS developers are going to put there color to anyways, so this feature should be naturally adopted by SwiftGen in my opinion.The text was updated successfully, but these errors were encountered: