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

# decodeCGSize(forKey:)

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

## Declaration

```swift
func decodeCGSize(forKey key: String) -> CGSize
```

## Parameters

- `key`: The key that identifies the size information.

## Return Value

Return Value The CGSize structure.

## 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:)-6wq3n.md)

### Decoding Geometry-Based Data

- [decodeCGAffineTransform(forKey:)](foundation/nscoder/decodecgaffinetransform(forkey:).md)
- [decodeCGPoint(forKey:)](foundation/nscoder/decodecgpoint(forkey:).md)
- [decodeCGRect(forKey:)](foundation/nscoder/decodecgrect(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)
