---
title: "readerSession(_:didInvalidateWithError:)"
framework: corenfc
role: symbol
role_heading: Instance Method
path: "corenfc/nfcndefreadersessiondelegate/readersession(_:didinvalidatewitherror:)"
---

# readerSession(_:didInvalidateWithError:)

Tells the delegate the reason for invalidating a reader session.

## Declaration

```swift
func readerSession(_ session: NFCNDEFReaderSession, didInvalidateWithError error: any Error)
```

## Parameters

- `session`: The session that has become invalid. Your app should discard any references it has to this session.
- `error`: The error indicating the reason for invalidation of the session.
