<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleArchive",
  "identifier" : "/documentation/AppleArchive/ArchiveHeader",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Apple Archive"
    ],
    "preciseIdentifier" : "s:12AppleArchive0B6HeaderC"
  },
  "title" : "ArchiveHeader"
}
-->

# ArchiveHeader

An AppleArchive entry header.

```
class ArchiveHeader
```

## Topics

### Creating an Archive Header

[`init()`](/documentation/AppleArchive/ArchiveHeader/init())

Creates a new empty archive header.

[`init?(keySet: ArchiveHeader.FieldKeySet, directory: FilePath, path: FilePath, flags: ArchiveFlags)`](/documentation/AppleArchive/ArchiveHeader/init(keySet:directory:path:flags:))

Creates a new archive header with fields derived from the filesystem object, at the specified directory and path.

[`init?(withAAEncodedData: UnsafeBufferPointer<UInt8>)`](/documentation/AppleArchive/ArchiveHeader/init(withAAEncodedData:))

Creates a new archive header from encoded data.

[`init(copying: ArchiveHeader)`](/documentation/AppleArchive/ArchiveHeader/init(copying:))

Creates a copy of an archive header.

### Manipulating Fields

[`func field(forKey: ArchiveHeader.FieldKey) -> ArchiveHeader.Field?`](/documentation/AppleArchive/ArchiveHeader/field(forKey:))

Returns the field for a specified key.

[`struct FieldKey`](/documentation/AppleArchive/ArchiveHeader/FieldKey-swift.struct)

A type that’s an alias for the field key structure.

[`enum Field`](/documentation/AppleArchive/ArchiveHeader/Field)

An enumeration that describes the type, key, and value of a header field.

[`var fieldType: ArchiveHeader._FieldTypes`](/documentation/AppleArchive/ArchiveHeader/fieldType-swift.property)

The field types of the archive header.

[`struct FieldType`](/documentation/AppleArchive/ArchiveHeader/FieldType-swift.struct)

Constants that specify the field type of an archive header.

[`var fieldKey: ArchiveHeader._FieldKeys`](/documentation/AppleArchive/ArchiveHeader/fieldKey-swift.property)

The field keys of the archive header.

[`class FieldKeySet`](/documentation/AppleArchive/ArchiveHeader/FieldKeySet)

An object that represents a field key set.

### Manipulating Entries

[`class EntryAttributes`](/documentation/AppleArchive/ArchiveHeader/EntryAttributes)

An object that describes archive entry attributes.

[`class EntryXATBlob`](/documentation/AppleArchive/ArchiveHeader/EntryXATBlob)

An object that describes the extended attributes of an archive entry.

[`var entryType: ArchiveHeader.EntryType?`](/documentation/AppleArchive/ArchiveHeader/entryType-swift.property)

The entry type from `TYP` field, or `nil` if missing or invalid.

[`struct EntryType`](/documentation/AppleArchive/ArchiveHeader/EntryType-swift.struct)

Constants that specify the filesystem entry types.

[`typealias EntryFilter`](/documentation/AppleArchive/ArchiveHeader/EntryFilter)

A type alias for the parameters passed to an archive stream operation’s entry selection and status closure.

[`struct EntryMessage`](/documentation/AppleArchive/ArchiveHeader/EntryMessage)

Constants that represent message values for the entry message filters.

[`enum EntryFilterData`](/documentation/AppleArchive/ArchiveHeader/EntryFilterData)

Enumerations that represent entry filter data.

[`struct EntryMessageStatus`](/documentation/AppleArchive/ArchiveHeader/EntryMessageStatus)

Statuses that you return from an archive stream operation’s entry selection and status closure.

### Accessing File Paths

[`var entryPath: FilePath?`](/documentation/AppleArchive/ArchiveHeader/entryPath)

The entry from the path field, or nil if missing or invalid.

### Accessing AppleArchive Encoded Data

[`func withAAEncodedData<R>((UnsafeBufferPointer<UInt8>) throws -> R) rethrows -> R`](/documentation/AppleArchive/ArchiveHeader/withAAEncodedData(_:))

Executes a closure with encoded data.

### Collection Requirements

[`func append(ArchiveHeader.Field)`](/documentation/AppleArchive/ArchiveHeader/append(_:))

[`func remove(at: Int) -> ArchiveHeader.Field`](/documentation/AppleArchive/ArchiveHeader/remove(at:))

[`func removeAll()`](/documentation/AppleArchive/ArchiveHeader/removeAll())

### Subscripts

### Instance Methods

## Relationships

### Conforms To

[`BidirectionalCollection`](/documentation/Swift/BidirectionalCollection)

[`Sequence`](/documentation/Swift/Sequence)

[`MutableCollection`](/documentation/Swift/MutableCollection)

[`Copyable`](/documentation/Swift/Copyable)

[`RandomAccessCollection`](/documentation/Swift/RandomAccessCollection)

[`Collection`](/documentation/Swift/Collection)

[`Escapable`](/documentation/Swift/Escapable)

---

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)