Re: Auto Layout and Resizable NSViews
Re: Auto Layout and Resizable NSViews
- Subject: Re: Auto Layout and Resizable NSViews
- From: Roland King <email@hidden>
- Date: Tue, 21 Jul 2015 08:38:59 +0800
> On 21 Jul 2015, at 08:23, Thomas Wetmore <email@hidden> wrote:
>>
>> As a side issue, given that you’ll need to update constraints and re-layout your view hierarchy every time the mouse moves during a drag, it might be worthwhile retooling your code to use mouseDown/mouseDragged events non-modally, instead of using your current modal loop.
>
> I am worried about the performance implications of this. Should I not be? Implementation will tell, of course.
Test it and see.
One point, don’t know if it was already covered as I’ve lost a bit of the thread. Constraints have constants which are amusing named as they’re the one thing you can change. Removing and replacing constraints is expensive and requires lots of recomputation, however just changing the constants on constraints is relatively cheap. So if you do try to do this by setting up and modifying constraints during the drag, see if you can manage to keep the constraint instances the same and just change the constants on them.
_______________________________________________
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