Core Animation based on Quartz provides very simple ways to create special effects in your game or application.
The following shows how to create a Resize Effect of any UIView (e.g. UIButtonView, UIImageView etc.)
- +(void)resize:(UIView*)view to:(CGSize)size withDuration:(int) duration andSnapBack:(BOOL) snapBack
- {
- // Prepare the animation from the old size to the new size
- CGRect oldBounds = view.layer.bounds;
- CGRect newBounds = oldBounds;
- newBounds.size = size;
- CABasicAnimation *animation =[CABasicAnimation animationWithKeyPath:@"bounds"];