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

Use CGSize to define fixed spacers #129

Open NickEntin opened 4 months ago

NickEntin commented 4 months ago

This allows reusing a view distribution in vertical or horizontal distributions (for example preferring a horizontal distribution if the views fit, falling back to vertical otherwise) where the spacer has a different value depending on the axis.

The additional static func allows most callsites to remain unchanged and preserves the simplicity of the most common case.