LiveUI / Awesome

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

How I can dynamic call icon name? #64

Open Zalarudo opened 2 years ago

Zalarudo commented 2 years ago

How can I use dynamic call icon from a string?

For example I get icon name from server and I need call it from lib

var body: some View{ 
VStack{
  if let faIcon :String = self.data.widgetData[i].icon {
     //faIcon - is icon name like "bomb" or something else
     Awesome.Solid.faIcon.image // here I get error "Type 'Awesome.Solid' has no member 'faIcon'"
  }
}
}

Is any way to solve this point?

klousy92 commented 2 years ago

Check my PR https://github.com/LiveUI/Awesome/pull/67