Re: Animating autolayout constraint changes for subviews

2017-01-03 Thread Doug Hill
Just out of curiosity, is it feasible to override the animation of an animatable property to implement this? For example, generating the layer contents with the reflowed text for a keyframe animation as the frame size changes. Presumably I could do this be overriding the behavior for animating

Re: Animating autolayout constraint changes for subviews

2016-12-30 Thread Doug Hill
> On Dec 30, 2016, at 11:56 AM, David Duncan wrote: > > >> On Dec 30, 2016, at 11:50 AM, Doug Hill wrote: >> >> >>> On Dec 30, 2016, at 11:38 AM, David Duncan wrote: >>> >>> On Dec 28, 2016, at 4:14 PM, Doug Hill wrote: Hi Ken, The exact behavior is that the la

Re: Animating autolayout constraint changes for subviews

2016-12-30 Thread David Duncan
> On Dec 30, 2016, at 11:50 AM, Doug Hill wrote: > > >> On Dec 30, 2016, at 11:38 AM, David Duncan wrote: >> >> >>> On Dec 28, 2016, at 4:14 PM, Doug Hill wrote: >>> >>> Hi Ken, >>> >>> The exact behavior is that the label will resize to the new size >>> immediately and reflow the text,

Re: Animating autolayout constraint changes for subviews

2016-12-30 Thread Doug Hill
> On Dec 30, 2016, at 11:38 AM, David Duncan wrote: > > >> On Dec 28, 2016, at 4:14 PM, Doug Hill wrote: >> >> Hi Ken, >> >> The exact behavior is that the label will resize to the new size immediately >> and reflow the text, then the container view will animate it's size change. >> It wou

Re: Animating autolayout constraint changes for subviews

2016-12-30 Thread David Duncan
> On Dec 28, 2016, at 4:14 PM, Doug Hill wrote: > > Hi Ken, > > I uploaded a sample project here: > > https://github.com/djfitz/TestAutolayoutAnimations > > I tried to strip this down to what is needed to show the behavior I see. > > My code to actually do the animation is this: > > - (IBAc

Re: Animating autolayout constraint changes for subviews

2016-12-28 Thread Steve Christensen
Sorry, I mostly copied your code and moved things around. Try -setNeedsLayout instead of -layoutIfNeeded. > On Dec 28, 2016, at 9:58 PM, Doug Hill wrote: > > Hello Steve, > > FWIW, I’ve tried both ways and it doesn’t seem to affect the problem I’m > having. However, Apple says to update cons

Re: Animating autolayout constraint changes for subviews

2016-12-28 Thread Doug Hill
Hello Steve, FWIW, I’ve tried both ways and it doesn’t seem to affect the problem I’m having. However, Apple says to update constraints than do the animation block with layoutIfNeeded, according to this WWDC session: https://developer.apple.com/videos/play/wwdc2012/228/?id=228

Re: Animating autolayout constraint changes for subviews

2016-12-28 Thread Steve Christensen
I have always put the thing that I'm animating into the animation block: - (IBAction)animateIt:(id)sender { static BOOL small = NO; small = !small; CGFloat newWidth = small ? self.view.frame.size.width / 2 : self.view.frame.size.width; [UIView animateWithDuratio

Re: Animating autolayout constraint changes for subviews

2016-12-28 Thread Doug Hill
Hi Ken, I uploaded a sample project here: https://github.com/djfitz/TestAutolayoutAnimations I tried to strip this down to what is needed to show the behavior I see. My code to actually do the animation is this: - (IBAction)animateIt:(id)sender { static BOOL small = NO; if( sm

Re: Animating autolayout constraint changes for subviews

2016-12-28 Thread Ken Thomases
On Dec 28, 2016, at 1:55 PM, Doug Hill wrote: > > I can now animate my constraint changes but I notice that subviews aren't > animated. For example, I have a single view with a width constraint, and this > view has a label as a subview that expands to the size of it's parent view > via edge co

Animating autolayout constraint changes for subviews

2016-12-28 Thread Doug Hill
I had a previous question to the list about animating autolayout constraint changes at runtime. The documentation on this is a little thin and was grateful for the list's suggestions on the correct way to do this. I can now animate my constraint changes but I notice that subviews aren't animate