UIMotionEffect

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];

 

Steps:

  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.

“Apple is doomed again”

Now there are some saying the same old “apple is doomed”.

Reason they say: They did not release the pre-order sales number.
Real Reason: Apple never ever breaks the sales number (model per se). The iPhone 5S is not available for pre-order until the 20th. This applies for the iPod sales number as well

other companies like Amazon never releases their hardware (kindle) sales figure.

DCIntrospect

When we use DCIntrospect, the NSNotification are delivered bit late. This may lead to debug problems, so turn them off once you have sorted out the layout