Skip to content

Instantly share code, notes, and snippets.

@ynechaev
Created December 25, 2013 14:48
Show Gist options
  • Save ynechaev/8123871 to your computer and use it in GitHub Desktop.
Save ynechaev/8123871 to your computer and use it in GitHub Desktop.
UIView 3d transform animation style: horizontal flip
UIView *myView = cell.containerView;
CALayer *layer = myView.layer;
CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -1000;
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI / 0.3, 0.0f, 1.0f, 0.0f);
layer.transform = rotationAndPerspectiveTransform;
[UIView animateWithDuration:1.0 animations:^{
layer.transform = CATransform3DIdentity;
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment