Swiftgen: Support System Images

Created on 2 Aug 2020  路  4Comments  路  Source: SwiftGen/SwiftGen

I find myself using more and more SF symbols in my apps. It's nice that these images by default are selectable from IB, but to use them in code I need to pass a string. It would be nice if SwiftGen could provide these through the Asset API.

question

All 4 comments

Interesting....

SwiftGen is meant to parse a resource and generate code based on that. What you needs sounds much more like a dedicated library, especially now that SF Symbols 2 will be arriving soon, with new and renamed symbols.

For this case, I'd recommend something like https://github.com/piknotech/SFSafeSymbols (or other libraries) that can take these details into account.

Note: there is a PR to extract code points from a font (for symbol fonts). But that wouldn't really help in this case, as the mechanism to access these symbols is very different.

Yes, I was also doubting if this kind of functionality would be relevant to SwiftGen but I thought it couldn't hurt just mentioning it. Thanks for the great suggestions!

Was this page helpful?
0 / 5 - 0 ratings