Re: NSSplitView question - how to implement my own "adjustViews" style method
Re: NSSplitView question - how to implement my own "adjustViews" style method
- Subject: Re: NSSplitView question - how to implement my own "adjustViews" style method
- From: Andy Lee <email@hidden>
- Date: Tue, 03 Jul 2012 11:11:34 -0400
On Jul 3, 2012, at 10:31 AM, Rainer Brockerhoff wrote:
>
> On Jul 3, 2012, at 11:03 , Andy Lee wrote:
>
>> I haven't used RBSplitView, but it sounds like it might be handy to have a method for replacing an already-set-up NSSplitView with an RBSplitView. Maybe it could be a category method on NSSplitView, something like this:
>> ...
>> This way you can still use IB to lay out the subviews of the split view, using a regular NSSplitView. In awakeFromNib, you can swap out the split view by calling this method.
>
>
> Now that's an interesting idea, thanks Andy! I'll look into it soon, I hope.
P.P.S. I'm not sure how to deal with autolayout constraints that might get broken. Does replaceSubview:with: transfer constraints that were on the old view to the new view? (It would have to do some behind-the-scenes trickery, since NSLayoutConstraint is immutable.)
What about the constraints on views within the subview panes? You *might* be okay there if all relevant constraints are contained in those views, but what if they're not? What if there's a constraint connecting a button inside one of the panes to a button outside of the split view entirely?
Might not be a problem in practice. The worst case might be that on rare occasions, the programmer will have to patch some broken constraints after calling +transmogrify:.
--Andy
_______________________________________________
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