---
title: "decodeCGAffineTransform(forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nscoder/decodecgaffinetransform(forkey:)"
---

# decodeCGAffineTransform(forKey:)

Decodes and returns the Core Graphics affine transform structure associated with the specified key in the coder’s archive.

## Declaration

```swift
func decodeCGAffineTransform(forKey key: String) -> CGAffineTransform
```

## Parameters

- `key`: The key that identifies the affine transform.

## Return Value

Return Value The affine transform.

## Discussion

Discussion Use this method to decode size information that was previously encoded using the encode(_:forKey:) method.

## See Also

### Related Documentation

- [encode(_:forKey:)](foundation/nscoder/encode(_:forkey:)-29jyx.md)

### Decoding Geometry-Based Data

- [decodeCGPoint(forKey:)](foundation/nscoder/decodecgpoint(forkey:).md)
- [decodeCGRect(forKey:)](foundation/nscoder/decodecgrect(forkey:).md)
- [decodeCGSize(forKey:)](foundation/nscoder/decodecgsize(forkey:).md)
- [decodeCGVector(forKey:)](foundation/nscoder/decodecgvector(forkey:).md)
- [decodeDirectionalEdgeInsets(forKey:)](foundation/nscoder/decodedirectionaledgeinsets(forkey:).md)
- [decodeUIEdgeInsets(forKey:)](foundation/nscoder/decodeuiedgeinsets(forkey:).md)
- [decodeUIOffset(forKey:)](foundation/nscoder/decodeuioffset(forkey:).md)
