I am trying to make the icon trembling.
When loading my controller, I create a timer as follows:
[NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(shakeIphonePic) userInfo:nil repeats:YES];
And here is my shaker method:
- (void)shakeIphonePic { [UIView animateWithDuration:0.09 delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{ self.iphonePic.layer.transform = CATransform3DMakeRotation(DegreesToRadians(8.0), 0.0, 0.0, 1.0); } completion:^(BOOL finished) { [UIView animateWithDuration:0.09 animations:^(void) { self.iphonePic.layer.transform = CATransform3DMakeRotation(DegreesToRadians(-16.0), 0.0, 0.0, 1.0); }]; } ]; }
This is not as good as I expected, but ... this is not the main problem.
It seems like this significantly slows down the rest of my user interface, which used to be good.
Can you suggest me a more efficient way to shake my icon?
Fabio B.
source share