connect(to_) - treastrain/TRETJapanNFCReader GitHub Wiki

connect(to:)

canImport(CoreNFC)

Connects the reader session to a tag and activates that tag.

@available(iOS 15.0, *)
    open func connect(to tag: NFCNDEFTag)

A tag stays connected until your app connects to a different tag or restarts polling. Connecting to a tag that is already connected has no effect.

Parameters

  • tag: A tag to which the reader session should attempt to connect.

Returns

A Result with the cases:​ success:​ A Void. failure:​ An NFCReaderError object indicating that a communication issue with the tag occurred.

connect(to:)

canImport(CoreNFC)

Connects the reader session to a tag and activates that tag.

@available(iOS 15.0, *)
    open func connect(to tag: NFCTag)

A tag stays connected until your app connects to a different tag or restarts polling. Connecting to a tag that is already connected has no effect.

Parameters

  • tag: A tag to which the reader session should attempt to connect.

Returns

A Result with the cases:​ success:​ A Void. failure:​ An NFCReaderError object indicating that a communication issue with the tag occurred.

⚠️ **GitHub.com Fallback** ⚠️