---
title: "MTOfflineDownloadDelegate | Mobile sdk | Mobile sdk ios | Ios"
description: "Delegate protocol for receiving offline download events."
---

> 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.

# MTOfflineDownloadDelegate

```
public protocol MTOfflineDownloadDelegate : AnyObject, Sendable
```

Delegate protocol for receiving offline download events.

-   `[offlinePack(_:didChangeState:)](#/s:11MapTilerSDK25MTOfflineDownloadDelegateP11offlinePack_14didChangeStateySS_AA0dhK0OtF)`
    
    Called when the pack’s state changes.
    
    #### Declaration
    
    Swift
    
    ```
    func offlinePack(_ pack: String, didChangeState state: MTOfflinePackState)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>pack</em></code></td><td><div><p>The ID of the offline pack.</p></div></td></tr><tr><td><code><em>state</em></code></td><td><div><p>The new state of the pack.</p></div></td></tr></tbody></table>
    
-   `[offlinePack(_:didUpdateProgress:)](#/s:11MapTilerSDK25MTOfflineDownloadDelegateP11offlinePack_17didUpdateProgressySS_AA0dhK0VtF)`
    
    Called when the pack’s download progress updates.
    
    #### Declaration
    
    Swift
    
    ```
    func offlinePack(_ pack: String, didUpdateProgress progress: MTOfflinePackProgress)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>pack</em></code></td><td><div><p>The ID of the offline pack.</p></div></td></tr><tr><td><code><em>progress</em></code></td><td><div><p>The current progress of the download.</p></div></td></tr></tbody></table>
    
-   `[offlinePack(_:didFailResource:context:)](#/s:11MapTilerSDK25MTOfflineDownloadDelegateP11offlinePack_15didFailResource7contextySS_AA0D5ErrorOAA0D7ContextVtF)`
    
    Called when a single resource download fails.
    
    #### Declaration
    
    Swift
    
    ```
    func offlinePack(_ pack: String, didFailResource error: MTOfflineError, context: MTOfflineContext)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>pack</em></code></td><td><div><p>The ID of the offline pack.</p></div></td></tr><tr><td><code><em>error</em></code></td><td><div><p>The error that occurred.</p></div></td></tr><tr><td><code><em>context</em></code></td><td><div><p>The context of the failure (e.g. URL).</p></div></td></tr></tbody></table>
    
-   `[offlinePack(_:didSucceedResource:)](#/s:11MapTilerSDK25MTOfflineDownloadDelegateP11offlinePack_18didSucceedResourceySS_AA0D7ContextVtF)`
    
    Called when a single resource download succeeds.
    
    #### Declaration
    
    Swift
    
    ```
    func offlinePack(_ pack: String, didSucceedResource context: MTOfflineContext)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>pack</em></code></td><td><div><p>The ID of the offline pack.</p></div></td></tr><tr><td><code><em>context</em></code></td><td><div><p>The context of the success (e.g. URL).</p></div></td></tr></tbody></table>
