<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/ObjectIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:SO"
  },
  "title" : "ObjectIdentifier"
}
-->

# ObjectIdentifier

A unique identifier for a class instance, actor instance, or metatype.

```
@frozen struct ObjectIdentifier
```

## Overview

This unique identifier is valid for comparisons only during the lifetime
of the instance.

In Swift, only instances of classes, instances of actors, and metatypes
have unique identities. There’s no notion of identity for structures,
enumerations, functions, or tuples.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Copyable`](/documentation/Swift/Copyable)

[`Escapable`](/documentation/Swift/Escapable)

[`AtomicRepresentable`](/documentation/Synchronization/AtomicRepresentable)

[`Hashable`](/documentation/Swift/Hashable)

[`Comparable`](/documentation/Swift/Comparable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`AtomicOptionalRepresentable`](/documentation/Synchronization/AtomicOptionalRepresentable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`ConvertibleToBytes`](/documentation/Swift/ConvertibleToBytes)

---

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)