---
title: ObjectIdentifier
framework: swift
role: symbol
role_heading: Structure
path: swift/objectidentifier
---

# ObjectIdentifier

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

## Declaration

```swift
@frozen struct ObjectIdentifier
```

## Overview

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.

## Topics

### Initializers

- [init(_:)](swift/objectidentifier/init(_:)-223xw.md)
- [init(_:)](swift/objectidentifier/init(_:)-52bz1.md)
- [init(_:)](swift/objectidentifier/init(_:)-86u7l.md)

### Default Implementations

- [AtomicOptionalRepresentable Implementations](swift/objectidentifier/atomicoptionalrepresentable-implementations.md)
- [AtomicRepresentable Implementations](swift/objectidentifier/atomicrepresentable-implementations.md)
- [Comparable Implementations](swift/objectidentifier/comparable-implementations.md)
- [CustomDebugStringConvertible Implementations](swift/objectidentifier/customdebugstringconvertible-implementations.md)
- [Equatable Implementations](swift/objectidentifier/equatable-implementations.md)
- [Hashable Implementations](swift/objectidentifier/hashable-implementations.md)

## Relationships

### Conforms To

- [AtomicOptionalRepresentable](synchronization/atomicoptionalrepresentable.md)
- [AtomicRepresentable](synchronization/atomicrepresentable.md)
- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Comparable](swift/comparable.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Querying Runtime Values

- [Mirror](swift/mirror.md)
- [type(of:)](swift/type(of:).md)
