Some older projects (like ours) may need to access the generated styles from objc, but the current codegen doesn't allow this. In order to achieve this, the @objc attribute can be optionally added in front of some generated properties.
Supported properties
UIFont extension for typography
UIColor extension for colors
UIImage extension for icons
UIImage extension for illustrations
Unsupported properties
I don't see a scenario where objc code would access properties generated for SwiftUI, so SwiftUI extension will ignore this option:
Font extension for typography
Color extension for colors
Image extension for icons
Image extension for illustrations
Additionally, the generated Labels use LabelStyle, which is defined as a struct. Adding support for objc would be a more significant and potentially breaking change:
Label
LabelStyle
Changes
Added an optional iOS param addObjcAttribute
Extracted typography export options into an XcodeTypographyOutput similar to XcodeColorOutput
Added tests for codegen with objc option turned on
Description
Some older projects (like ours) may need to access the generated styles from objc, but the current codegen doesn't allow this. In order to achieve this, the
@objc
attribute can be optionally added in front of some generated properties.Supported properties
UIFont
extension for typographyUIColor
extension for colorsUIImage
extension for iconsUIImage
extension for illustrationsUnsupported properties
I don't see a scenario where objc code would access properties generated for SwiftUI, so SwiftUI extension will ignore this option:
Font
extension for typographyColor
extension for colorsImage
extension for iconsImage
extension for illustrationsAdditionally, the generated
Label
s useLabelStyle
, which is defined as astruct
. Adding support for objc would be a more significant and potentially breaking change:Label
LabelStyle
Changes
addObjcAttribute
XcodeTypographyOutput
similar toXcodeColorOutput
CONFIG.md
Example/figma-export.yaml
Example-SwiftUI/figma-export.yaml
Example output
Icons
Images
Colors
Typography