<!--
{
  "availability" : [
    "iOS: 12.0.0 -",
    "iPadOS: 12.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.14.0 -",
    "tvOS: 12.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/nw_txt_record_t",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "c:@T@nw_txt_record_t"
  },
  "title" : "nw_txt_record_t"
}
-->

# nw_txt_record_t

A dictionary representing a TXT record in a DNS packet.

```
typealias nw_txt_record_t = any OS_nw_txt_record
```

## Topics

### Creating TXT Records

[`nw_txt_record_create_dictionary()`](/documentation/Network/nw_txt_record_create_dictionary())

Initializes a TXT record as a dictionary of strings.

[`nw_txt_record_create_with_bytes(_:_:)`](/documentation/Network/nw_txt_record_create_with_bytes(_:_:))

Initializes a TXT record with raw bytes.

[`nw_txt_record_copy(_:)`](/documentation/Network/nw_txt_record_copy(_:))

Performs a deep copy of a TXT record.

[`nw_txt_record_set_key(_:_:_:_:)`](/documentation/Network/nw_txt_record_set_key(_:_:_:_:))

Sets a data value in a TXT record dictionary.

[`nw_txt_record_remove_key(_:_:)`](/documentation/Network/nw_txt_record_remove_key(_:_:))

Removes a data value in a TXT record dictionary.

### Examining TXT Records

[`nw_txt_record_is_dictionary(_:)`](/documentation/Network/nw_txt_record_is_dictionary(_:))

Checks whether a TXT record conforms to a dictionary format.

[`nw_txt_record_get_key_count(_:)`](/documentation/Network/nw_txt_record_get_key_count(_:))

Accesses the number of keys stored in the TXT record dictionary.

[`nw_txt_record_apply(_:_:)`](/documentation/Network/nw_txt_record_apply(_:_:))

Iterates through all keys in a TXT record dictionary.

[`nw_txt_record_applier_t`](/documentation/Network/nw_txt_record_applier_t)

A block that iterates over values and keys in a TXT record dictionary.

[`nw_txt_record_access_key(_:_:_:)`](/documentation/Network/nw_txt_record_access_key(_:_:_:))

Accesses the value for a specific key in a TXT record dictionary.

[`nw_txt_record_access_key_t`](/documentation/Network/nw_txt_record_access_key_t)

A block that returns a value in a TXT record dictionary.

[`nw_txt_record_find_key(_:_:)`](/documentation/Network/nw_txt_record_find_key(_:_:))

Checks the status of value associated with a key in a TXT record dictionary.

[`nw_txt_record_find_key_t`](/documentation/Network/nw_txt_record_find_key_t)

Status values describing what kind of value is stored in a TXT record dictionary.

[`nw_txt_record_is_equal(_:_:)`](/documentation/Network/nw_txt_record_is_equal(_:_:))

Checks whether two TXT records are equivalent.

[`nw_txt_record_access_bytes(_:_:)`](/documentation/Network/nw_txt_record_access_bytes(_:_:))

Accesses the raw bytes contained within a TXT record.

[`nw_txt_record_access_bytes_t`](/documentation/Network/nw_txt_record_access_bytes_t)

A block that provides access to the raw bytes of a TXT record.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)