-(void)showErrorAnimationIsPassoword:(BOOL)isPassword
{
CAKeyframeAnimation *shakeAnim = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
shakeAnim.values = @[@-10, @0, @10, @0];
shakeAnim.repeatCount = 3;
shakeAnim.duration = 0.1;
if (isPassword)
{
[self.loginView.passwordView.layer addAnimation:shakeAnim forKey:nil];
}
else
{
[self.loginView.phoneView.layer addAnimation:shakeAnim forKey:nil];
}
}
网友评论