iosswiftcatransform3dcatransform3drotate

Chaining three CATtansform3D in Swift


Is it possible to chaining three CAtransform3D (rotate, scale, translate) in Swift?

I'm using CATransform3DConcat but it's only chaining 2 transforms

If yes, how i can do it? If no, is there any "cheats" to do it?

Thank you


Solution

  • Assuming your transforms are called t1, t2 and t3. Then do this:

    let t = CATransform3DConcat(t1, CATransform3DConcat(t2, t3))