LiveUI / Awesome

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

Update Awesome/AwesomePro, make enums CaseIterable and add withKey fu… #67

Closed klousy92 closed 1 year ago

klousy92 commented 2 years ago

Adding CaseIterable to enums allows us to call them dynamicly with rawValue

Awesome.Regular(rawValue: "\u{f007}")?.image AwesomePro.Regular(rawValue: "\u{f640}")?.image

Additionally by adding the static withKey function to the enums, we can call icons by the key value as a string

Awesome.Regular.withKey("user")?.image AwesomePro.Regular.withKey("bell")?.image

daemedeor commented 1 year ago

I'd like to point out this is an auto-generated file that you're modifying. So any changes you're making to the file will fail the next time they auto generate the file

klousy92 commented 1 year ago

You are definetly right, didn't update the generator logic. Your PR #69 is worth to be reviewd.