LiveUI / Awesome

FontAwesome 6 Swift & SwiftUI implementation for iOS, tvOS & macOS
MIT License
97 stars 27 forks source link

Iterate over all icons? #66

Open Miodec opened 2 years ago

Miodec commented 2 years ago

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