mamaral / Neon

A powerful Swift programmatic UI layout framework.
MIT License
4.58k stars 389 forks source link

UILabel width #31

Closed tim12s closed 8 years ago

tim12s commented 8 years ago

Hi,

Great work on making a super flexible and simple layout framework.

Any chance you can have tried to have UIButton and UILabel to automatically calculate their widths as per below where the width of a button/label can be calculated from its contents?

button1.anchorInCornerAndUseWidth(.BottomLeft, xPad: 20, yPad: 20, height: 30) label2.alignAndUseWidth(align: .ToTheRightMatchingTop, relativeTo: button1, padding: 20, height: 30) button3.alignAndFillWidth(align: .ToTheRightMatchingTop, relativeTo: label2, padding: 20, height: 30)

Thanks for the elegant work, -Tim

tim12s commented 8 years ago

It seems extending the framework and copying the AutoHeight concept to AutoWidth does the trick. I'll submit a pull request.

mamaral commented 8 years ago

Excellent, thank you!

tim12s commented 8 years ago

Submitted #32 for review

mamaral commented 8 years ago

Thanks again!