Class

NFCNDEFPayload

A payload record in an NFC NDEF message.

Declaration

class NFCNDEFPayload : NSObject

Overview

An NDEF message payload consists of the Type Name Format field (as defined by the NDEF specification), type, identifier, and data.

Topics

Creating a Payload Record

class func wellKnownTypeURIPayload(url: URL) -> Self?

Creates a payload record with a URI specified as a URL.

Beta
class func wellKnownTypeURIPayload(string: String) -> Self?

Creates a payload record with a URI specified as a string.

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

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

Beta
init(format: NFCTypeNameFormat, type: Data, identifier: Data, payload: Data, chunkSize: Int)

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

Beta

Getting Information About a Payload Record

var identifier: Data

The identifier of the payload, as defined by the NDEF specification.

var payload: Data

The payload, as defined by the NDEF specification.

var type: Data

The type of the payload, as defined by the NDEF specification.

var typeNameFormat: NFCTypeNameFormat

The Type Name Format field of the payload, as defined by the NDEF specification.

enum NFCTypeNameFormat

The Type Name Format values that specify the content type for the payload data in an NFC NDEF message.

Getting the URI from a Payload Record

func wellKnownTypeURIPayload() -> URL?

Returns the URL of a valid Well Known Type URI payload.

Beta

Relationships

Inherits From

See Also

NDEF Messages and Payloads

class NFCNDEFMessage

An NFC NDEF message consisting of an array of payload records.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software