Re: Quickie about constraints
Re: Quickie about constraints
- Subject: Re: Quickie about constraints
- From: Graham Cox <email@hidden>
- Date: Sat, 16 Aug 2014 13:17:02 +1000
On 15 Aug 2014, at 7:39 pm, Jonathan Mitchell <email@hidden> wrote:
>
> On 15 Aug 2014, at 04:55, Graham Cox <email@hidden> wrote:
>
>> I ask because I'm having trouble getting part of my interface working with autolayout, though other parts work fine. Since the part that doesn't work works just fine with struts-and-springs, and has done for a long time, I'm wondering if I can use a mix of autolayout and the 'old way' in a single window, specifically, in two different panes of a split view.
>
> You should be okay. The layout system will convert autoresizing masks into constraints for any views that don’t support Auto Layout.
>
> https://developer.apple.com/library/mac/releasenotes/UserExperience/RNAutomaticLayout/#//apple_ref/doc/uid/TP40010631-CH1-SW22
>
> Jonathan
OK, I understand that autoresizing masks are converted, but one key issue is that I've read (in comments here) that when using constrants, I shouldn't use -setFrame: on a view, but instead modify the constraints. Using -setFrame: is a key part of what my old code does, and that works fine with struts and springs. If these are translated to constraints, it may be that things work OK until I call -setFrame:, at which point it blows up.
What I really want is that part of my view hierarchy to be free to use -setFrame:, but other parts use the autolayout constraints normally. The object is to avoid rewriting working code that has been functional for a decade, and so introducing a whole bunch of new bugs that will need a load of time to eliminate that I just don't have. There may be no general solution, but since the particular view is the content of a scroller, it might be possible to come up with a special case for this, because it seems constraints can't cross "scroller barriers", and that might therefore allow me to isolate the use of -setFrame: to this particular case.
--Graham
_______________________________________________
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