[OSX][iOS]アニメーションの種類(基本) | Cocoa練習帳

[OSX][iOS]アニメーションの種類(基本)

Basic Animationは、fromValueとtoValueに設定した二つの値を補間するアニメーションだ。




- (CABasicAnimation *)opacityAnimation
{
    CABasicAnimation *animation = [CABasicAnimation animation];
    animation.duration = 3.0;
    animation.fromValue = [NSNumber numberWithFloat:1.0];
    animation.toValue = [NSNumber numberWithFloat:0.0];
    return animation;
}



これを適用するとアニメーションが開始されると、不透明から、透明に徐々に変わってゆく。




関連情報
Core Animation for Max OS X and the iPhone



【Cocoa練習帳】
http://www.bitz.co.jp/weblog/

http://ameblo.jp/bitz/(ミラー・サイト)