Closed mpospese closed 2 years ago
Due to longstanding bugs in Xcode (since 2020), IBDesignable does not work for view code contained in Swift Packages. Because YMatterType is of course a Swift Package, I fear that these components will never correctly render in Interface Builder. If a future version of Xcode ever fixes this (still broken in Xcode 14.1 rc2 as of late October 2022), then we can revisit this work.
Intro
As part of adding IB support to our Typography UI elements, it would be nice to (1) be able to see the control rendered in IB, (2) be able to set the typography
Discussion
Unfortunately,
@IBInspectable
only works with fixed types such asInt
,CGFloat
,UIColor
,CGRect
, etc. It cannot work for our structTypography
. However, most of the properties ofTypography
correspond to these types, so let's try to forward them. e.g.This is a bit exploratory, so want to try it only for the label for now. If it works and seems valuable, we can extend to button, text field, and text view.
Task
TypographyLabel
and make sure it renders properly in Interface Buildertypography
property, on set create a new typography from the existing one but mutating the specified property)CGFloat
)AC
Blocked By