Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack function changes translatesAutoresizingMaskIntoConstraints of superview #93

Open
OCJvanDijk opened this issue Dec 13, 2020 · 0 comments

Comments

@OCJvanDijk
Copy link

Hi there, small problem I've found with this library:
When using the stack(_:axis:width:height:spacing:) function, it will set translatesAutoresizingMaskIntoConstraints = false on the superview.
Unless I'm missing something, this is unnecessary and unexpected, and not in line with how the rest of the library works.

Small example how this could go wrong:

let cell = UICollectionViewCell()
let image = UIImageView()
let label = UILabel()
cell.contentView.stack([image, label])

Here, the contentView is managed by UIKit, but will be changed by the stack function. This did in fact break the layout of my UICollectionView.

It's a small issue and the fix is removing one line of code. I get this would be a breaking change and I don't know if it's worth it, but I wanted to share anyway.

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

No branches or pull requests

1 participant