3sidedcube / cubefoundation-ios

Extensions, objects, and utilities used across newer 3SC iOS projects.
Apache License 2.0
0 stars 0 forks source link

🟠 Normal: Add initializer for integer on `Font.Weight` [Small] #17

Closed BenShutt closed 1 year ago

3SCSamDavis commented 1 year ago

What's the purpose of this change? 🙂

BenShutt commented 1 year ago

What's the purpose of this change? 🙂

@3SCSamDavis so we can define a font-weight with a property as well. E.g.

let someConstant = 400

TextStyle(
    weight: .init(integer: someConstant)
)

I'm planning to use it in Fusion where the weight it provided in a JSON. Relying on an integer literal relies on the Swift dev writing the code