---
title: "init(format:type:identifier:payload:)"
framework: corenfc
role: symbol
role_heading: Initializer
path: "corenfc/nfcndefpayload/init(format:type:identifier:payload:)"
---

# init(format:type:identifier:payload:)

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

## Declaration

```swift
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

Return Value A newly initialized payload record object.

## Discussion

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

- [wellKnownTypeURIPayload(url:)](corenfc/nfcndefpayload/wellknowntypeuripayload(url:).md)
- [wellKnownTypeURIPayload(string:)](corenfc/nfcndefpayload/wellknowntypeuripayload(string:).md)
- [wellKnownTypeTextPayload(string:locale:)](corenfc/nfcndefpayload/wellknowntypetextpayload(string:locale:).md)
- [init(format:type:identifier:payload:chunkSize:)](corenfc/nfcndefpayload/init(format:type:identifier:payload:chunksize:).md)
- [wellKnowTypeTextPayload(string:locale:)](corenfc/nfcndefpayload/wellknowtypetextpayload(string:locale:).md)
