---
title: delegate
framework: nearbyinteraction
role: symbol
role_heading: Instance Property
path: nearbyinteraction/nisession/delegate
---

# delegate

An object that the framework notifies of session events.

## Declaration

```swift
weak var delegate: (any NISessionDelegate)? { get set }
```

## Discussion

Discussion An app must set a delegate to receive the peer’s distance and direction information through session(_:didUpdate:). The session(_:didInvalidateWith:) and session(_:didRemove:reason:) callbacks notify you when the session invalidated or removed a peer. The system may suspend an interaction session for various reasons (see sessionWasSuspended(_:)), such as when the peer backgrounds the app.

## See Also

### Managing life cycle

- [pause()](nearbyinteraction/nisession/pause().md)
- [invalidate()](nearbyinteraction/nisession/invalidate().md)
