---
title: NotificationCenter.ObservationToken
framework: foundation
role: symbol
role_heading: Structure
path: foundation/notificationcenter/observationtoken
---

# NotificationCenter.ObservationToken

A unique token representing a single observer registration in a notification center.

## Declaration

```swift
struct ObservationToken
```

## Overview

Overview You receive the ObservationToken type as a return value from addObserver(of:for:using:) and related methods. Retain the ObservationToken for as long as you need to continue observation, since observation ends when the token goes out of scope. You can also explicitly stop observing by passing the token to removeObserver(_:)-(ObservationToken).

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Observing concurrency-safe notifications

- [addObserver(of:for:using:)](foundation/notificationcenter/addobserver(of:for:using:)-4d19x.md)
- [addObserver(of:for:using:)](foundation/notificationcenter/addobserver(of:for:using:)-90os.md)
- [addObserver(of:for:using:)](foundation/notificationcenter/addobserver(of:for:using:)-56bn4.md)
- [addObserver(of:for:using:)](foundation/notificationcenter/addobserver(of:for:using:)-twm3.md)
- [addObserver(of:for:using:)](foundation/notificationcenter/addobserver(of:for:using:)-t1wr.md)
- [addObserver(of:for:using:)](foundation/notificationcenter/addobserver(of:for:using:)-64uw3.md)
- [removeObserver(_:)](foundation/notificationcenter/removeobserver(_:)-2gmm0.md)
