<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Observation/ObservationRegistrar",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Observation"
    ],
    "preciseIdentifier" : "s:11Observation0A9RegistrarV"
  },
  "title" : "ObservationRegistrar"
}
-->

# ObservationRegistrar

Provides storage for tracking and access to data changes.

```
struct ObservationRegistrar
```

## Overview

You don’t need to create an instance of `ObservationRegistrar` when using the
[`Observable()`](/documentation/Observation/Observable()) macro to indicate observability of a
type.

## Topics

### Creating an observation registrar

[`init()`](/documentation/Observation/ObservationRegistrar/init())

Creates an instance of the observation registrar.

### Receiving change notifications

[`willSet(_:keyPath:)`](/documentation/Observation/ObservationRegistrar/willSet(_:keyPath:))

A property observation called before setting the value of the subject.

[`didSet(_:keyPath:)`](/documentation/Observation/ObservationRegistrar/didSet(_:keyPath:))

A property observation called after setting the value of the subject.

### Identifying transactional access

[`access(_:keyPath:)`](/documentation/Observation/ObservationRegistrar/access(_:keyPath:))

Registers access to a specific property for observation.

[`withMutation(of:keyPath:_:)`](/documentation/Observation/ObservationRegistrar/withMutation(of:keyPath:_:))

Identifies mutations to the transactions registered for observers.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)