---
title: "MTOfflinePackMetadata | Mobile sdk | Mobile sdk ios | Ios"
description: "Metadata information about an offline pack."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTOfflinePackMetadata

```
public struct MTOfflinePackMetadata : Codable, Equatable, Sendable
```

Metadata information about an offline pack.

This model is used to persist pack information such as its identifier, current state, total size, and creation date.

-   `[id](#/s:11MapTilerSDK21MTOfflinePackMetadataV2id10Foundation4UUIDVvp)`
    
    The unique identifier of the pack.
    
    #### Declaration
    
    Swift
    
    ```
    public let id: UUID
    ```
    
-   `[state](#/s:11MapTilerSDK21MTOfflinePackMetadataV5stateAA0dE5StateOvp)`
    
    The current state of the pack.
    
    #### Declaration
    
    Swift
    
    ```
    public var state: MTOfflinePackState
    ```
    
-   `[size](#/s:11MapTilerSDK21MTOfflinePackMetadataV4sizes5Int64Vvp)`
    
    The total size of the pack in bytes.
    
    #### Declaration
    
    Swift
    
    ```
    public var size: Int64
    ```
    
-   `[createdAt](#/s:11MapTilerSDK21MTOfflinePackMetadataV9createdAt10Foundation4DateVvp)`
    
    The date when the pack was created.
    
    #### Declaration
    
    Swift
    
    ```
    public let createdAt: Date
    ```
    
-   `[expiresAt](#/s:11MapTilerSDK21MTOfflinePackMetadataV9expiresAt10Foundation4DateVvp)`
    
    The date when the pack expires.
    
    #### Declaration
    
    Swift
    
    ```
    public var expiresAt: Date
    ```
    
-   `[context](#/s:11MapTilerSDK21MTOfflinePackMetadataV7context10Foundation4DataVSgvp)`
    
    Optional custom data, typically used to store application-specific context (e.g. JSON data).
    
    #### Declaration
    
    Swift
    
    ```
    public let context: Data?
    ```
    
-   `[region](#/s:11MapTilerSDK21MTOfflinePackMetadataV6regionAA0D16RegionDefinitionVvp)`
    
    The region definition specifying the bounding box, zoom levels, and style.
    
    #### Declaration
    
    Swift
    
    ```
    public let region: MTOfflineRegionDefinition
    ```
    
-   `[totalResources](#/s:11MapTilerSDK21MTOfflinePackMetadataV14totalResourcesSivp)`
    
    Total number of resources required for the pack.
    
    #### Declaration
    
    Swift
    
    ```
    public var totalResources: Int
    ```
    
-   `[totalTileResources](#/s:11MapTilerSDK21MTOfflinePackMetadataV18totalTileResourcesSivp)`
    
    Total number of tile resources required for the pack.
    
    #### Declaration
    
    Swift
    
    ```
    public var totalTileResources: Int
    ```
    
-   `[downloadedResources](#/s:11MapTilerSDK21MTOfflinePackMetadataV19downloadedResourcesSivp)`
    
    Number of resources that have been successfully downloaded.
    
    #### Declaration
    
    Swift
    
    ```
    public var downloadedResources: Int
    ```
    
-   `[isExpired](#/s:11MapTilerSDK21MTOfflinePackMetadataV9isExpiredSbvp)`
    
    Returns true if the pack has passed its expiration date.
    
    #### Declaration
    
    Swift
    
    ```
    public var isExpired: Bool { get }
    ```
    
-   `[init(id:region:state:size:createdAt:expiresAt:context:totalResources:downloadedResources:totalTileResources:)](#/s:11MapTilerSDK21MTOfflinePackMetadataV2id6region5state4size9createdAt07expiresL07context14totalResources010downloadedP00o4TileP0AC10Foundation4UUIDV_AA0D16RegionDefinitionVAA0dE5StateOs5Int64VAN4DateVAXSgAN4DataVSgS3itcfc)`
    
    Initializes a new offline pack metadata object.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        id: UUID = UUID(),
        region: MTOfflineRegionDefinition,
        state: MTOfflinePackState = .pending,
        size: Int64 = 0,
        createdAt: Date = Date(),
        expiresAt: Date? = nil,
        context: Data? = nil,
        totalResources: Int = 0,
        downloadedResources: Int = 0,
        totalTileResources: Int = 0
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>id</em></code></td><td><div><p>The unique identifier for the pack. Defaults to a new UUID.</p></div></td></tr><tr><td><code><em>region</em></code></td><td><div><p>The region definition for the pack.</p></div></td></tr><tr><td><code><em>state</em></code></td><td><div><p>The initial state of the pack. Defaults to <code>.pending</code>.</p></div></td></tr><tr><td><code><em>size</em></code></td><td><div><p>The initial size of the pack in bytes. Defaults to 0.</p></div></td></tr><tr><td><code><em>createdAt</em></code></td><td><div><p>The creation date of the pack. Defaults to the current date.</p></div></td></tr><tr><td><code><em>expiresAt</em></code></td><td><div><p>The expiration date of the pack. Defaults to 30 days from now.</p></div></td></tr><tr><td><code><em>context</em></code></td><td><div><p>Optional custom context data. Defaults to nil.</p></div></td></tr><tr><td><code><em>totalResources</em></code></td><td><div><p>Total resources for the pack. Defaults to 0.</p></div></td></tr><tr><td><code><em>downloadedResources</em></code></td><td><div><p>Downloaded resources for the pack. Defaults to 0.</p></div></td></tr><tr><td><code><em>totalTileResources</em></code></td><td><div><p>Total tile resources for the pack. Defaults to 0.</p></div></td></tr></tbody></table>
    
-   `[init(from:)](#/s:Se4fromxs7Decoder_p_tKcfc)`
    
    #### Declaration
    
    Swift
    
    ```
    public init(from decoder: Decoder) throws
    ```
