MTOfflineDownloadDelegate

public protocol MTOfflineDownloadDelegate : AnyObject, Sendable

Delegate protocol for receiving offline download events.

  • Called when the pack’s state changes.

    Declaration

    Swift

    func offlinePack(_ pack: String, didChangeState state: MTOfflinePackState)

    Parameters

    pack

    The ID of the offline pack.

    state

    The new state of the pack.

  • Called when the pack’s download progress updates.

    Declaration

    Swift

    func offlinePack(_ pack: String, didUpdateProgress progress: MTOfflinePackProgress)

    Parameters

    pack

    The ID of the offline pack.

    progress

    The current progress of the download.

  • Called when a single resource download fails.

    Declaration

    Swift

    func offlinePack(_ pack: String, didFailResource error: MTOfflineError, context: MTOfflineContext)

    Parameters

    pack

    The ID of the offline pack.

    error

    The error that occurred.

    context

    The context of the failure (e.g. URL).

  • Called when a single resource download succeeds.

    Declaration

    Swift

    func offlinePack(_ pack: String, didSucceedResource context: MTOfflineContext)

    Parameters

    pack

    The ID of the offline pack.

    context

    The context of the success (e.g. URL).