Mutating NSLayoutConstraint -constant at run time
Mutating NSLayoutConstraint -constant at run time
- Subject: Mutating NSLayoutConstraint -constant at run time
- From: Jonathan Mitchell <email@hidden>
- Date: Mon, 26 May 2014 21:41:14 +0100
So:
1. I have a NSView V within a view hierarchy.
2. V holds a layout constraint C that offsets a subview S from the bottom edge of V.
3. At runtime I mutate -constant on constraint C.
The question is should the view hierarchy automatically recalculate its layout in response to changing the constant on C?
In practice I find that I have to call -layoutSubtreeIfNeeded on a superview of V.
I do not have to call -setNeedsLayout:YES
Note:
My actual implementation is more complex than the above.
V exists with an NSStackView subclass, so there are a lot of constraints at play.
However, if I can clarify the above it will help my thinking.
Jonathan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden