<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSCoder/decodeCGPoint(forKey:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCoder(im)decodeCGPointForKey:"
  },
  "title" : "decodeCGPoint(forKey:)"
}
-->

# decodeCGPoint(forKey:)

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

```
func decodeCGPoint(forKey key: String) -> CGPoint
```

## Parameters

`key`

The key that identifies the point.

## Return Value

The `CGPoint` structure.

## Discussion

Use this method to decode a point that was previously encoded using the [`encode(_:forKey:)`](/documentation/Foundation/NSCoder/encode(_:forKey:)-7z9kc) method.

## See Also

[`encode(_:forKey:)`](/documentation/Foundation/NSCoder/encode(_:forKey:)-7z9kc)

Encodes a point and associates it with the specified key in the receiver’s archive.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)