On Aug 4, 2014, at 6:10 PM, Rick Mann <rm...@latencyzero.com> wrote:

> I'm setting the constant of a center-y-in-container constraint in a [UIView 
> animateWith…] block, but it doesn't animate; it just jumps to the offset 
> location. Any idea what I might be doing wrong? The code is pretty 
> straightforward…
> 
>       https://pastee.org/edgsf
> 
> I tried calling -animateWithDuration directly, and enqueueing it on the main 
> queue (as seen here). Same result.
> 
> Any help would be much appreciated.

There are two approaches, but I don't know if the second applies on iOS.

First, the way you did it, is to just set the constraint constant.  However, 
you then have to force layout.  The constraint itself is not being animated.  
The changes to the frames that are done within the animation group are.  So, 
you need to call [self layoutIfNeeded] within the animation group.

The second way is to animate the constraint itself.  In this case, you change 
the constant on the constraint's animator proxy, not directly on the 
constraint.  So, you'd do self.logoVerticalConstraint.animator.constant = 100.

Cheers,
Ken


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to