RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project
MIT License
719 stars 115 forks source link

Autogenerated code fails to compile when the icons are using a reserved word #130

Closed agarcia-wish closed 2 years ago

agarcia-wish commented 2 years ago

Here are a few examples for Swift:

    static var class: UIImage { UIImage(named: #function, in: BundleProvider.bundle, compatibleWith: nil)! }
    static var extension: UIImage { UIImage(named: #function, in: BundleProvider.bundle, compatibleWith: nil)! }
    static var return: UIImage { UIImage(named: #function, in: BundleProvider.bundle, compatibleWith: nil)! }

Expected:

    static var `class`: UIImage { UIImage(named: #function, in: BundleProvider.bundle, compatibleWith: nil)! }
    static var `extension`: UIImage { UIImage(named: #function, in: BundleProvider.bundle, compatibleWith: nil)! }
    static var `return`: UIImage { UIImage(named: #function, in: BundleProvider.bundle, compatibleWith: nil)! }
subdan commented 2 years ago

I've fixed the issue. Please update to the latest version.