I'm creating a method that shakes my UITextField and use POP to do the heavy lifting.
- (void)textFieldErrorAnimation {
POPSpringAnimation *shake = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
shake.springBounciness = 10;
shake.velocity = @(2000);
[self.value.layer pop_addAnimation:shake forKey:@"shakeValue"];
[self.year.layer pop_addAnimation:shake forKey:@"shakeYear"];
}
It seems to be working when I apply the animation to the object "value" but not when it's applied to "value" and "year" at the same time.
I know I can create a shake2, shake3 etc so basically one for each textField but it seems strange that i'd need to do that.
Any ideas how I can reuse this animation?