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

Iterate over all icons? #66

Open
Miodec opened this issue Jul 4, 2022 · 0 comments
Open

Iterate over all icons? #66

Miodec opened this issue Jul 4, 2022 · 0 comments

Comments

@Miodec
Copy link

Miodec commented Jul 4, 2022

Im looking to create an icon picker, and tried this:

ForEach(Awesome.Brand) { item in
    //
}

But this gives an error: Cannot convert value of type 'Awesome.Brand.Type' to expected argument type 'Range<Int>'

I also tried:

private var icons = [Awesome.Brand.apple, Awesome.Brand.google]

...

ForEach(icons) { item in
    ///
}

But that gives another error: Referencing initializer 'init(_:content:)' on 'ForEach' requires that 'Awesome.Brand' conform to 'Identifiable'

Is there anyway to do this? Could the creator just add Identifiable to the icon groups? Im still new so not sure if that's the solution here.

Thanks

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