CAKeyframeAnimation* animation = [CAKeyframeAnimationanimationWithKeyPath:@"transform.translation.x"];
CGFloatcurrentTx =addShopImageView.transform.tx;
animation.delegate=self;
animation.duration=0.3;
animation.values=@[@(currentTx),@(currentTx +10),@(currentTx-8),@(currentTx +8),@(currentTx -5),@(currentTx +5),@(currentTx)];
animation.keyTimes=@[@(0),@(0.225),@(0.425),@(0.6),@(0.75),@(0.875),@(1)];
animation.timingFunction= [CAMediaTimingFunctionfunctionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[addShopImageView.layeraddAnimation:animationforKey:@"DSAddShopSnakeAnimation"];
网友评论