square / Paralayout

Paralayout is a set of simple, useful, and straightforward utilities that enable pixel-perfect layout in iOS. Your designers will love you.
https://medium.com/square-corner-blog/introducing-paralayout-d5ac09e93fb0
Apache License 2.0
790 stars 34 forks source link

Support sizing labels accounting for their cap insets #136

Open NickEntin opened 3 months ago

NickEntin commented 3 months ago

We already support aligning and distributing labels taking into account their cap insets, but sizing currently requires the entire available space. We should add equivalent APIs for sizing:

func capInsetSizeThatFits(_ size: CGSize, constraints: SizingConstraints = .none) -> CGSize

func capInsetSizeToFit(_ size: CGSize, constraints: SizingConstraints = .none)