Skip to content

Instantly share code, notes, and snippets.

@sneakyness
Created September 20, 2013 21:54
Show Gist options
  • Save sneakyness/6644441 to your computer and use it in GitHub Desktop.
Save sneakyness/6644441 to your computer and use it in GitHub Desktop.
crunchitize me, captain!!!!
// insert in viewDidLoad for fun wobbly time
UIInterpolatingMotionEffect *mxx = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"layer.transform.rotation.y" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
mxx.maximumRelativeValue = @-0.75;
mxx.minimumRelativeValue = @0.75;
UIInterpolatingMotionEffect *mxy = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"layer.transform.rotation.x" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
mxy.maximumRelativeValue = @-0.75;
mxy.minimumRelativeValue = @0.75;
for (UIView* subview in self.view.subviews) {
[subview addMotionEffect:mxx];
[subview addMotionEffect:mxy];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment