facebookarchive / pop

An extensible iOS and OS X animation library, useful for physics-based interactions.
Other
19.66k stars 2.88k forks source link

No assertion when toValue or fromValue is of an incompatible type #356

Open zats opened 7 years ago

zats commented 7 years ago

I make this mistake very often: when creating animation for kPOPLayerScaleXY I set to and from values to NSNumber not CGSize

It would be great to see an exception or assertion. Currently it just silently fails:

POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerScaleXY];
anim.springBounciness = 4;
anim.springSpeed = 5;
anim.fromValue = @.94; // silently fails, layer never becomes visible
anim.toValue = @1; // same