Skip to content

CATransform3D: affineTransform property ​

The affineTransform property is the two-dimensional part of this transform, as a CGAffineTransform.

Value ​

A CGAffineTransform whose six numbers come from these fields:

CGAffineTransform fieldTaken from
am11
bm12
cm21
dm22
txm41
tym42
  • Read-only. Each read returns a new object.
  • The other ten numbers are dropped. Only when isAffine is true does the two-dimensional transform have the same effect as the original; when there is anything in the z direction or perspective, it is just what remains after removing those.

Examples ​

js
const t = CATransform3D.translation(5, 6);
if (t.isAffine) {
  console.log(String(t.affineTransform));
}

Result: logs CGAffineTransform(1, 0, 0, 1, 5, 6).

Corresponding iOS API ​

CATransform3DGetAffineTransform(t).

See also ​