1

I am new to ios development. i want different animation styles like flipboard animations.can any one give me some sample examples.

Thanks in advance

Vishnu
  • 371
  • 1
  • 2
  • 17
  • 1
    possible duplicate of [How to flip between views like FlipBoard Animation in iOS?](http://stackoverflow.com/questions/12947925/how-to-flip-between-views-like-flipboard-animation-in-ios) – Will Sheppard Sep 30 '15 at 10:02
  • i need other animations examples – Vishnu Sep 30 '15 at 10:18
  • other than flip and fold animations,can any one give other animation names i.e animation list – Vishnu Sep 30 '15 at 11:50

2 Answers2

0

I don't have any experience in this, but after reading the docs, I think you're going to need a library for that. A quick Google search suggested:

If you want to code your own custom animation, it appears that the apple documentation explains how.

Will Sheppard
  • 3,272
  • 2
  • 31
  • 41
0

You can use a library, but it is possible to transform the layer of a UIView in many ways, quite easily.

Say the view you want to animate is called view and is of type UIView

Here is how to animate it similar to a flip animation, where it rotates around the y-axis:

CALayer *layer = view.layer;

CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform = CATransform3DTranslate(rotationAndPerspectiveTransform, 0, 0, 20);

rotationAndPerspectiveTransform.m34 = 5.0 / -500;

rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, angle* M_PI / 180.0f, 0.0f, 1.0f, 0.0f);
layer.transform = rotationAndPerspectiveTransform;

The key function here is CATransform3DRotate which rotates the layer in 3d.

You specify the axis around which to rotate with the last 3 parameters (x, y, z) which is (0,1,0) in this case, i.e. the y-axis.

Note that this won't produce an animation, but rather, will orient the layer using the provided axis and angle.

To animate the layer, you will have to incrementally change the angle, in another function (e.g. using NSTimer).

bilo-io
  • 597
  • 3
  • 17