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

# decodeUIOffset(forKey:)

Decodes and returns the UIKit offset structure associated with the specified key in the coder’s archive.

```
func decodeUIOffset(forKey key: String) -> UIOffset
```

## Parameters

`key`

The key that identifies the offset.

## Return Value

The offset data.

## Discussion

Use this method to decode offset information that was previously encoded using the [`encode(_:forKey:)`](/documentation/Foundation/NSCoder/encode(_:forKey:)-9d1qy) method.

## See Also

[`encode(_:forKey:)`](/documentation/Foundation/NSCoder/encode(_:forKey:)-9d1qy)

Encodes offset data and associates it with the specified key in the coder’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)