Skip to content

NDEFMessage

treastrain edited this page May 17, 2021 · 2 revisions

NDEFMessage

public struct NDEFMessage 

Initializers

init(records:)

Creates an NDEF message with the specified records.

@available(*, unavailable, message: "This initializer is not yet implemented.")
    public init(records: [NDEFPayload]) 

Parameters

  • records: An array of payload objects for the message. To create an empty message, pass in an empty array.

init?(data:)

Creates an NDEF message from raw data representing the message.

@available(*, unavailable, message: "This initializer is not yet implemented.")
    public init?(data: Data) 

Parameters

  • data: A data object containing the raw bytes of a complete NDEF message. The data must contain only one NDEF message, and the message must contain NDEF payloads that are valid according to the NFC Forum NDEF RTD specification.

init(from:)

os(iOS) && !targetEnvironment(macCatalyst)
@available(iOS 13.0, *)
    public init(from coreNFCInstance: CoreNFC.NFCNDEFMessage) 

Properties

records

An array of records for the message.

public let records: [NDEFPayload]

length

The length, in bytes, of the NDEF message when stored on an NFC tag.

public let length: Int

The maximum length of an NDEF message is 128 KB.

Clone this wiki locally