if ([gestureRecognizer state]==UIGestureRecognizerStateBegan)
{
CABasicAnimation *shake = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
shake.fromValue = [NSNumber numberWithFloat:-M_PI/300];
shake.toValue = [NSNumber numberWithFloat:M_PI/300];
shake.duration=0.1;
shake.autoreverses = YES;//是否重复
shake.repeatCount =100000000000;
// 这是在九宫格图标上添加叉号
for (UIView *view in scllView.subviews)
{
if ([view isMemberOfClass:[UIView class]])
{
for (UIView *deltView in view.subviews)
{
if ([deltView isMemberOfClass:[UIButton class]])
{
for (UIView*aviw in deltView.subviews)
{
if ([aviw isMemberOfClass:[UIButton class]])
{
[aviw setHidden:NO];
}
}
}
}
}
view.layer.edgeAntialiasingMask=16;
[view.layer addAnimation:shake forKey:@"shakeAnimation"];
}
[ UIView animateWithDuration:0.1 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:nil completion:nil];
}