-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Symbol Categories #104
Comments
@narwahle Thanks for raising this issue! As I wrote in #75, I feel like we can't make sensible use of the category information. But now, that you raise this issue, that's probably no longer true. I'm just wondering which specific use case you have in mind: Do you suggest just to add documentation or would you like a method like We may also need to take a look on the effect on the complexity, size & scalability of the library when implementing such features, but let's first clearly define what features you suggest to add. |
Hi fredepi, I was ideally thinking of a method to return an array of all symbols matching a specified category. For my particular use case I'm implementing a feature where users set a custom icon for a folder, having categories included for each SFSymbols would allow a simple way to categories the icons in the picker UI. Agreed there is a risk this impacts the size of the library due to the ver growing size, but as Apple is now providing the information it would be nice to expose this extra data. |
@narwahle Thanks for the reply! Then I suggest we offer a For the purpose of getting an array of symbols of one category, one could then write Regarding the implementation, we have two options:
Unfortunately, I currently don't have the time to implement this myself, but I'll happily discuss the implementation approach and review a PR by someone else. Maybe @Stevenmagdy and @knothed can also comment. |
As @fredpi said, the dictionary approach would be very good to have before implementing this feature. However the global dictionary would be of type |
@knothed That's also an option – then, the association between symbol raw value and symbol localizations and symbol categories would be made on initialization with Performance-wise, the approach suggested by @Stevenmagdy would probably be better (if it can be realized lazily), because otherwise the (potentially not so fast) dictionary lookup would be performed on every |
My use case would be to build a picker with search functionality on top of this package. It seems to be the best-maintained one. And it would be great to group them by categories. There is https://github.com/alessiorubicini/SFSymbolsPickerForSwiftUI, but it does not have SFSymbols 4.0 support. |
Has there been any progress on adding this? |
Hi,
It would be helpful to add the symbol categories from the symbol.categories.plist file in SF Symbols.app to SFSymbol class to make sorting / filtering images in a view easier.
The text was updated successfully, but these errors were encountered: