16種動畫切換效果
case 101:
animation.type =kCATransitionFade;
break;
case102:
animation.type =kCATransitionPush;
break;
case103:
animation.type =kCATransitionReveal;
break;
case104:
animation.type =kCATransitionMoveIn;
break;
case201:
animation.type =@"cube";
break;
case202:
animation.type =@"suckEffect";
break;
case203:
animation.type =@"oglFlip";
break;
case204:
animation.type =@"rippleEffect";
break;
case205:
animation.type =@"pageCurl";
break;
case206:
animation.type =@"pageUnCurl";
break;
case207:
animation.type =@"cameraIrisHollowOpen";
break;
case208:
animation.type =@"cameraIrisHollowClose";
副主題類型:
case 0:
animation.subtype =kCATransitionFromLeft;
break;
case 1:
animation.subtype =kCATransitionFromBottom;
break;
case 2:
animation.subtype =kCATransitionFromRight;
break;
case 3:
animation.subtype =kCATransitionFromTop;
CATransition* animation = [CATransition animation];
[animation setDuration:0.5f];
[animation setType:kCATransitionFade];//波紋效果 @“rippleEffect”
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
[[self.view layer]addAnimation:animation forKey:@"switchView"];
[[self.view layer] addAnimation:animation forKey:@"animation"];