画像の変更効果の設定
1358 ワード
主な記録効果の文字(ドキュメント内の不完全)
NSString *name = [NSString stringWithFormat:@"pet_%ld",self.index];
self.imageView.image = [UIImage imageNamed:name];
CATransition *transition = [CATransition animation];
/* The name of the transition. Current legal transition types include
* `fade', `moveIn', `push' and `reveal'. Defaults to `fade'.
pageCurl
pageUnCurl
rippleEffect
suckEffect ,
cube
oglFlip
*/
NSArray *types = @[@"fade",
@"moveIn",
@"push",
@"reveal",
@"pageCurl",
@"pageUnCurl",
@"rippleEffect",
@"suckEffect",
@"cube",
@"oglFlip"
];
NSInteger index = random() % types.count;
transition.type = types[index];
transition.subtype = @"fromRight";
transition.duration = 2.0;
//1.5
transition.startProgress=0.2;
transition.delegate = self;
[self.imageView.layer addAnimation:transition forKey:nil];