<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreNFC",
  "identifier" : "/documentation/CoreNFC/NFCNDEFReaderSession/init(delegate:queue:invalidateAfterFirstRead:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core NFC"
    ],
    "preciseIdentifier" : "c:objc(cs)NFCNDEFReaderSession(im)initWithDelegate:queue:invalidateAfterFirstRead:"
  },
  "title" : "init(delegate:queue:invalidateAfterFirstRead:)"
}
-->

# init(delegate:queue:invalidateAfterFirstRead:)

Creates and initializes a new NFC NDEF reader session.

```
init(delegate: any NFCNDEFReaderSessionDelegate, queue: dispatch_queue_t?, invalidateAfterFirstRead: Bool)
```

## Parameters

`delegate`

The NFC NDEF delegate that handles reader session callbacks.

`queue`

A queue onto which delegate callbacks are dispatched (the session retains the queue). When `queue` is `nil`, an internal serial dispatch queue is created for the session.

`invalidateAfterFirstRead`

A Boolean value that indicates whether the session automatically invalidates after the first NDEF tag is successfully read.

## Discussion

When `invalidateAfterFirstRead` is <doc://com.apple.documentation/documentation/Swift/false>, the reader session can read multiple NFC tags. For each successful read, the delegate’s [`readerSession(_:didDetectNDEFs:)`](/documentation/CoreNFC/NFCNDEFReaderSessionDelegate/readerSession(_:didDetectNDEFs:)) method delivers the message. A reader session that can read multiple tags terminates when the session times out or when the session is canceled by the client app (by calling [`invalidate()`](/documentation/CoreNFC/NFCReaderSessionProtocol/invalidate())) or the user (via the user interface).

> Note:
> When creating the reader session that your app uses to write an NDEF message to a tag, set `invalidateAfterFirstRead` to <doc://com.apple.documentation/documentation/Swift/false>. This keeps the session active so that your app can write a message to the tag.

When `invalidateAfterFirstRead` is <doc://com.apple.documentation/documentation/Swift/true>, the reader session automatically terminates after the first NFC tag is successfully read. In this scenario, the delegate receives the [`NFCReaderError.Code.readerSessionInvalidationErrorFirstNDEFTagRead`](/documentation/CoreNFC/NFCReaderError-swift.struct/Code/readerSessionInvalidationErrorFirstNDEFTagRead) status in [`readerSession(_:didInvalidateWithError:)`](/documentation/CoreNFC/NFCNDEFReaderSessionDelegate/readerSession(_:didInvalidateWithError:)).

---

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)