добавление эффекта отскока к внешнему виду UIImageView

Как я могу добавить эффект отскока, когда я собираюсь показать UIImageView как подпредставление? Нужно ли мне для этого использовать CoreAnimation? Сейчас я думаю только об использовании CAKeyframeAnimation. Пожалуйста, дайте мне знать, есть ли способ лучше. Вот мой текущий код:

 CABasicAnimation * theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
    theAnimation.delegate = self;
    theAnimation.duration = 1.0;
    theAnimation.fromValue = [NSNumber numberWithFloat:notif.center.y];
    theAnimation.toValue = [NSNumber numberWithFloat:notif.center.y-20];
    theAnimation.repeatCount = 3;
14
задан TigerCoding 11 November 2011 в 19:57
поделиться