-
Notifications
You must be signed in to change notification settings - Fork 191
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
[WIP] Fixes issues with the arrangedSubviews property #17
base: master
Are you sure you want to change the base?
Conversation
- removing a view from the arranged subviews now does not remove it as a subview (like UIStackView) - this needed a strong separation between subviews and arrangedSubviews, not just having arrangedSubviews be all non-hidden subviews - implemented the arrangedSubviews @Property, which was previously unused - arrangedSubviews is now KVO’able
I've discovered some bugs after I filed the PR, so it definitely deserves the |
This looks like a change to the correct direction, working with visible views was not really the optimal solution and I wanted to move away from it. I agree with your decision with going with arranged view storage. |
…in the aligning axis This prevents arranged subviews from growing outside the stack view’s frame. This could happen if the size of the stackview was constrained so it could not become its intrinsic size.
I just pushed some more commits to this PR. Not all of them strictly relate to the arrangedSubviews change, but I've been trying to make improvements to
|
@Thomvis — Ping on this one? I just ran into some of the |
view.translatesAutoresizingMaskIntoConstraints = NO; | ||
[self addSubview:view]; | ||
- (void)didAddSubview:(UIView *)subview { | ||
[self addObserverForView:subview]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing calls to super
This is quite a big PR, so please bear with me and let me know if you are open for changes like this.
I found that the
arrangedSubviews
property was not properly implemented. For starters, it was alwaysnil
. Looking for a solution, I found that the heavy reliance onself.subviews
made it impossible to implement arranged subviews. I started shuffling things around and here we are...Main improvements:
All the tests pass and the example project runs fine, but I'd like to do some more testing in my own project. Let me know what you think!