With iOS7 we got UImotionEffect, an abstract class, you can subclass this to add your own custom motion effect or  use UIInterpolatingMotionEffect.

Adding Motion effect to your app is simple and easy. Just played with UIInterpolationMotionEffect. here is how you do it.


self.tiltMotionEffectHorizontal = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@”center.x” type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];

        self.tiltMotionEffectHorizontal.minimumRelativeValue = [NSNumber numberWithFloat:-100];

        self.tiltMotionEffectHorizontal.maximumRelativeValue = [NSNumber numberWithFloat:100];

        self.tiltMotionEffectVertical = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@”center.y” type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];

        self.tiltMotionEffectVertical.minimumRelativeValue = [NSNumber numberWithFloat:-100.0];

        self.tiltMotionEffectVertical.maximumRelativeValue = [NSNumber numberWithFloat:100.0];        

        [self addMotionEffect:_tiltMotionEffectHorizontal];

        [self addMotionEffect:_tiltMotionEffectVertical];



  1. Create an instance of the motion effect with the key path to animate.
  2. Set the maximum & minimum amount to map the system values of -1 to +1. (in this example its -100 to +100)
  3. Add the effect to the view you want to animate.


that’s it…

Now its your time to play with this & write your own custom class of motion effects.