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

Behavior mismatch between removeArrangedSubview: and removeFromSuperview #93

Open
brunnoferreira opened this issue Aug 14, 2016 · 0 comments

Comments

@brunnoferreira
Copy link

brunnoferreira commented Aug 14, 2016

Hey there, @oarrabi!

First of all, thanks for OAStackView and all the effort you put into it. I was just playing with it and replaced a previously iOS 9-only codebase without many issues, but found an odd one.

The original code, which uses UIStackView, follows Apple's guidelines and removes subviews by calling removeFromSuperview. Here's what the docs say about removeArrangedSubview::

This method removes the provided view from the stack’s arrangedSubviews array. The view’s position and size will no longer be managed by the stack view. However, this method does not remove the provided view from the stack’s subviews array; therefore, the view is still displayed as part of the view hierarchy.

OAStackView, on the other hand, seems to expect subviews to be removed by using removeArrangedSubview:, isn't that right? Directly calling removeFromSuperview breaks the constraints system most of the time unfortunately.

I can happily submit a PR with fixes for that if you agree with the changes. I just wanted to make sure the project is still under development first.

Thanks!

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