One Logo Pool Ball
CoreNFC · IOS API REFERENCE

NFCTagReaderSession

class · iOS 13.0+ · SDK 27.1

class NFCTagReaderSession

Members (7)

method · iOS 13.0+

restartPolling

TypeScript
restartPolling(): void
Swift declaration
func restartPolling()
get · iOS 13.0+

connectedTag

TypeScript
get connectedTag(): (NFCTag) | null
Swift declaration
var connectedTag: NFCTag? { get }

Current connected tag object.

init · iOS 26.4+

init

TypeScript
static initConfigurationDelegateQueue(configuration: NFCTagReaderSession_Configuration, delegate: SDKHandle, queue?: (_Dispatch_DispatchQueue) | null): NFCTagReaderSession
Swift declaration
convenience init(configuration: NFCTagReaderSession.Configuration, delegate: any NFCTagReaderSessionDelegate, queue: DispatchQueue? = nil)

Creates a new NFCTagReaderSession instance. - Parameters: - configuration: Reader configuration used for the session. The config is applied when `begin()` or `restartPolling()` is called. - delegate: The session will hold a weak ARC reference to this `NFCTagReaderSessionDelegate` object. - queue: A dispatch queue where `NFCTagReaderSessionDelegate` delegate callbacks will be dispatched to. A nil value will cause the creation of a serial dispatch queue internally for the session. The session object will retain the provided dispatch queue.

init · iOS 13.0+ · Deprecated in iOS 26.4

init

TypeScript
static initPollingOptionDelegateQueue(pollingOption: NFCTagReaderSession_PollingOption, delegate: SDKHandle, queue?: (_Dispatch_DispatchQueue) | null): (NFCTagReaderSession) | null
Swift declaration
convenience init?(pollingOption: NFCTagReaderSession.PollingOption, delegate: any NFCTagReaderSessionDelegate, queue: DispatchQueue? = nil)

Creates a new NFCTagReaderSession instance. - Parameters: - pollingOption: Configures the RF polling of the reader session; multiple options can be OR'ed together. This option affects the possible NFC tag type discover. - delegate: The session will hold a weak ARC reference to this `NFCTagReaderSessionDelegate` object. - queue: A dispatch queue where `NFCTagReaderSessionDelegate` delegate callbacks will be dispatched to. A nil value will cause the creation of a serial dispatch queue internally for the session. The session object will retain the provided dispatch queue.

method · iOS 26.4+

restartPolling

TypeScript
restartPollingConfiguration(configuration: NFCTagReaderSession_Configuration): void
Swift declaration
func restartPolling(configuration: NFCTagReaderSession.Configuration)

Restart the polling sequence in this session to discover new tags using the provided configuration. New tags discovered from polling will return in the subsequent `NFCTagReaderSessionDelegate.tagReaderSession(_:, didDetect:)` call. Tags that are returned previously by `NFCTagReaderSessionDelegate.tagReaderSession(_:, didDetect:)` will become invalid, and all references to these tags shall be removed to properly release the resources. Calling this method on an invalidated session will have no effect; a new reader session is required to restart the reader.

method · iOS 13.0+

connect

TypeScript
connectToCompletionHandler(tag: NFCTag, completionHandler: ((arg0: (NativeError) | null) => void)): void
Swift declaration
@preconcurrency func connect(to tag: NFCTag, completionHandler: @escaping @Sendable ((any Error)?) -> Void)

This method establishes a tag connection and activates the tag. Connecting to the same tag that is currently opened has no effect. Connecting to a different tag will automatically terminate the previous tag connection and put it into the halt state. Tag stays in the connected state until another tag is connected or the polling is restarted. - Parameters: - tag: A `NFCTag` object that will be connect to. - completionHandler: Completion handler called when the operation is completed. `error` is nil if operation succeeds. A `NFCErrorDomain` error is returned when there is a communication issue with the tag.

method · iOS 13.0+

connect

TypeScript
connectTo(tag: NFCTag): Promise<void>
Swift declaration
func connect(to tag: NFCTag) async throws

This method establishes a tag connection and activates the tag. Connecting to the same tag that is currently opened has no effect. Connecting to a different tag will automatically terminate the previous tag connection and put it into the halt state. Tag stays in the connected state until another tag is connected or the polling is restarted. - Parameters: - tag: A `NFCTag` object that will be connect to. - completionHandler: Completion handler called when the operation is completed. `error` is nil if operation succeeds. A `NFCErrorDomain` error is returned when there is a communication issue with the tag.

Skipped declarations

3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NFCTagReaderSession.init(configuration:delegate:queue:)

The iOS SDK compiler rejected this binding: 'NFCTagReaderSessionConfiguration' is unavailable in Swift: Use NFCTagReaderSession.Configuration

NFCTagReaderSession.restartPolling(with:)

The iOS SDK compiler rejected this binding: 'NFCTagReaderSessionConfiguration' is unavailable in Swift: Use NFCTagReaderSession.Configuration

NFCTagReaderSession.init()

inherited init: cannot prove legal (class declares 3 custom initializers)

All CoreNFC types →