Created
June 30, 2013 01:03
-
-
Save ajamaica/5893344 to your computer and use it in GitHub Desktop.
UIInterpolatingMotionEffect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
need other code? mine doesn't gonna work