(Flip) Method 1:
[NSTimer scheduledTimerWithTimeInterval: repeats:YES block:^(NSTimer * _Nonnull timer) { CABasicAnimation* rotationAnimation = [CABasicAnimation animation];; rotationAnimation = [CABasicAnimation animationWithKeyPath:@""]; = [NSNumber numberWithFloat: M_PI * 2.0 ]; = 1; // Switch the interface to ensure that the animation does not stop = NO; = 1; [ addAnimation:rotationAnimation forKey:@"rotationAnimation"]; }];
(Flip) Method 2 (This method is better):
CABasicAnimation *waitAnimation = [CABasicAnimation animation]; = [NSNumber numberWithFloat:1.0]; = ; = ; CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@""]; = [NSNumber numberWithFloat: M_PI * 2.0 ]; = ; CAAnimationGroup *group = [CAAnimationGroup animation]; = ; = CGFLOAT_MAX; = NO; [group setAnimations:@[waitAnimation, rotationAnimation]]; [ addAnimation:group forKey:@"bindCardImageViewAnimation"];
Jitter:
CABasicAnimation* shake = [CABasicAnimation animationWithKeyPath:@""]; //Set the jitter amplitude = [NSNumber numberWithFloat:-0.2]; = [NSNumber numberWithFloat:+0.2]; = 0.1; = YES; //Does it be repeated = 3; [ addAnimation:shake forKey:@"imageView"];
The above iOS animation - the method of flipping and shaking the UIView regularly is all the content I share with you. I hope you can give you a reference and I hope you can support me more.