Skip to content

Instantly share code, notes, and snippets.

@ajamaica
Created June 30, 2013 01:03
Show Gist options
  • Save ajamaica/5893344 to your computer and use it in GitHub Desktop.
Save ajamaica/5893344 to your computer and use it in GitHub Desktop.
UIInterpolatingMotionEffect
UIInterpolatingMotionEffect *mx = [[UIInterpolatingMotionEffect alloc]
initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
mx.maximumRelativeValue = @-39.0;
mx.minimumRelativeValue = @39.0;
UIInterpolatingMotionEffect *mx2 = [[UIInterpolatingMotionEffect alloc]
initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
mx2.maximumRelativeValue = @-39.0;
mx2.minimumRelativeValue = @39.0;
//Make sure yourView's bounds are beyond the canvas viewport - because it's being moved by values.
[self.tabBar addMotionEffect:mx];
[self.tabBar addMotionEffect:mx2];
@sunnyxx
Copy link

sunnyxx commented Sep 30, 2013

need other code? mine doesn't gonna work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment