基本的に、次のようにポイントを中心にレイヤーを回転させています。
CATransform3D transform = CATransform3DIdentity;
transform.m34 = 1.0 / -500;
transform = CATransform3DTranslate(transform, rotationPoint.x-center.x, rotationPoint.y-center.y, 0.0);
transform = CATransform3DRotate(transform, (rotationAngleFor) * M_PI / 180.0f, 0.0, 1.0, 0);
transform = CATransform3DTranslate(transform, center.x-rotationPoint.x, center.y-rotationPoint.y, 0.0);
また、レイヤーを作成し、それをより大きなレイヤーに追加してから、変換を適用します。
[self.layer addSublayer:myLayer];
myLayer.transform = transform;
これをアニメートする方法は?
注 -これをUIView
アニメーション ブロックに配置しても機能しません。