Quantcast
Channel: specialeffects Feed
Viewing all articles
Browse latest Browse all 3

How to Move UIViews using Core Animation in iOS?

$
0
0

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 Move Effect of any UIView (e.g. UIButtonView, UIImageView etc.)

  1. +(void)move:(UIView*)view to:(CGPoint)point withDuration:(int) duration andSnapBack:(BOOL) snapBack
  2. {
  3.     // Prepare the animation from the current position to the new position
  4.     CABasicAnimation *animation =[CABasicAnimation animationWithKeyPath:@"position"];
  5.     animation.fromValue =[view.layer valueForKey:@"position"];
  6.    
  7.    
  8.     // iOS

Viewing all articles
Browse latest Browse all 3

Trending Articles