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
Right now in cacao all symbols are hardcoded and I personally believe there's no real reason for this, and if a symbol doesn't exist; you could just do it like how SwiftUI does it where it's just a blank image and it warns you that it doesn't exist if the OS doesn't support it
Because of this, this is currently how I am having to do SF symbols (if anyone does use this, please note that this isn't safe and will crash if the OS doesn't support it, in my app this doesn't really matter to me though)
Which works nicely, I can use symbols from Sequoia now in my Cacao app:
I am requesting that something similar to my function could maybe be included in Cacao to prevent any confusion; I'm not really sure what the best and cleanest way of integrating this would be but I think it could be discussed a little here; I personally like how SwiftUI does it again but ofcourse this isn't very rust-y
Image(systemName:"house.fill")
The text was updated successfully, but these errors were encountered:
I personally believe there's no real reason for this
I mean, this is a bit personal - I'll take an enum variant over a string littering the codebase any day. ;)
That said...
I am requesting that something similar to my function could maybe be included in Cacao to prevent any confusion
I think your desired functionality is entirely appropriate and I'd welcome a PR. It might sit for a small bit since I've got a number of things to merge here - and I'm currently on a boat in Antarctica - but I'll get to it eventually. :)
Re: functionality, it could either be a method on SFSymbol or Image for now (e.g SFSymbol::image_from("symbol")) or Image could be rearchitected to be more of a builder type. I'm open to ideas as well.
I came up with Image::with_system_symbol_name("icon.name"). I guess this is a little subjective but i went ahead and PR'd this, can be discussed more there if needed
Right now in cacao all symbols are hardcoded and I personally believe there's no real reason for this, and if a symbol doesn't exist; you could just do it like how SwiftUI does it where it's just a blank image and it warns you that it doesn't exist if the OS doesn't support it
Because of this, this is currently how I am having to do SF symbols (if anyone does use this, please note that this isn't safe and will crash if the OS doesn't support it, in my app this doesn't really matter to me though)
Which works nicely, I can use symbols from Sequoia now in my Cacao app:
I am requesting that something similar to my function could maybe be included in Cacao to prevent any confusion; I'm not really sure what the best and cleanest way of integrating this would be but I think it could be discussed a little here; I personally like how SwiftUI does it again but ofcourse this isn't very rust-y
The text was updated successfully, but these errors were encountered: