2011/11/13

CATransionでレイヤーを消すアニメーション

- (IBAction)anyAcition:(id)sender{
    
    /*Use the select type. 
     suckEffect, spewEffect, genieEffect, unGenieEffect, twist, tubey, swirl, 
     cameraIris, cameraIrisHollowClose, cameraIrisHollowOpen, rippleEffect, 
     charminUltra, zoomyIn, and zoomyOut.*/
    
    CATransition *animation = [CATransition animation];

    //アニメーションのタイプ
    animation.type = @"rippleEffect";
    //継続期間
    animation.duration = 0.5f;
    
    drawImage.image = nil;
    //アニメーションを登録
    [self.view.layer addAnimation:animation forKey:@"transitionViewAnimation"];
 [self.view addSubview:drawImage];
    
}