---
title: "init(data:)"
framework: corenfc
role: symbol
role_heading: Initializer
path: "corenfc/nfcndefmessage/init(data:)"
---

# init(data:)

Creates an NDEF message from raw data representing the message.

## Declaration

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

## Return Value

Return Value An NDEF message, or nil when the raw data is invalid.

## See Also

### Creating an NDEF Message

- [init(records:)](corenfc/nfcndefmessage/init(records:).md)
