Is there currently a way to use the Facebook Pop framework with auto-layout or do you have to use springs and struts? I keep reading that it is possible, but I don't know what the syntax is to be able to animate a view's top constraint.
In this case you want to animate an NSLayoutConstraint you can do the following with POP and it will animate the constraint. Note that the POPSpringAnimation is being added to the constraint itself.
NSLayoutConstraint *constraint = // this is an NSLayoutConstraint that is applied to some view
POPSpringAnimation *layoutAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayoutConstraintConstant];
layoutAnimation.springSpeed = 20.0f;
layoutAnimation.springBounciness = 15.0f;
layoutAnimation.toValue = @(value to go too);
[constraint pop_addAnimation:layoutAnimation forKey:@"detailsContainerWidthAnimate"];
The main property to use is the kPOPLayoutConstraintConstant as shown above. So if you want to do it on auto layout constraints you can use this constraint property.
Working with scale and other properties also works with AutoLayout so you should have no issues with getting POP to work with AutoLayout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With