Contents

init(format:type:identifier:payload:)

Creates a payload record with the specified format, type, identifier, and payload data.

Declaration

init(format: NFCTypeNameFormat, type: Data, identifier: Data, payload: Data)

Parameters

  • format:

    A NFC type name format value.

  • type:

    A data object describing the type of payload. If the data is empty, the method excludes this field from the payload record.

  • identifier:

    A URI reference that identifies the payload. If the data is empty, the method excludes this field from the payload record.

  • payload:

    A data object containing the payload data. If the data is empty, the method excludes this field from the payload record.

Return Value

A newly initialized payload record object.

Discussion

This initializer uses the maximum payload chunk size defined by the NFC NDEF specification, which is 2^32-1 octets. If the payload size is bigger than the maximum size, the initializer splits the record into multiple record chunks.

See Also

Creating a Payload Record