Skip to content
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 a secured nullable constructor for SFSymbol. #123

Open
ShikiSuen opened this issue Oct 13, 2023 · 0 comments
Open

Add a secured nullable constructor for SFSymbol. #123

ShikiSuen opened this issue Oct 13, 2023 · 0 comments

Comments

@ShikiSuen
Copy link

Currently, if I want to use circled numbers in a for-loop, I have to use this approach:

                                    let matchedSymbol = SFSymbol(rawValue: "\(index + 1).circle")
                                    if SFSymbol.allSymbols.contains(matchedSymbol) {

What if SFSymbol(maybeRawValue: String) which returns a nullable SFSymbol?
This can simplify the things above into:

if let matchedSymbol = SFSymbol(maybeRawValue: "\(index + 1).circle") {

FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant