NFCTagReaderSessionDelegate - treastrain/TRETJapanNFCReader GitHub Wiki
NFCTagReaderSessionDelegate
Tag reader session delegate.
public protocol NFCTagReaderSessionDelegate: AnyObject
Inheritance
AnyObject
Requirements
tagReaderSessionDidBecomeActive(_:)
Tells the delegate that the reader session is active.
func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession)
The reader session calls this method after the device begins scanning for new tags.
Parameters
- session: The active reader session. Only one session can be active at a time.
tagReaderSession(_:didDetect:)
Tells the delegate that the session detected NFC tags.
func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag])
The polling options specified when creating an NFCTagReaderSession
object determine the types of tags that the session can detect.
Parameters
- session: The session that detected the tags.
- tags: An array of NFC tags detected by the session.
tagReaderSession(_:didInvalidateWithError:)
Tells the delegate the reason for invalidating a reader session.
func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: 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.