Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

heightToFit and widthToFit enhancements #11

Closed
Otbivnoe opened this issue Dec 28, 2017 · 0 comments
Closed

heightToFit and widthToFit enhancements #11

Otbivnoe opened this issue Dec 28, 2017 · 0 comments
Assignees

Comments

@Otbivnoe
Copy link
Owner

Otbivnoe commented Dec 28, 2017

Problem:

Have the following code:

// label has a long text ... 
label.configureFrame { maker in
    maker.edges(top: 30, left: 10, right: 10)
    maker.heightToFit()
}

This code has one problem: heightToFit doesn't take into account the left and right relations - the height of the label will be as for a one-line label.

Conclusion:

Need to consider specific relations such as left and right together, width and width(to:).

P.S. The similar for widthToFit.
P.S. widthThatFits and heightThatFits will have the similar logic only with a max setted value.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant