---
title: "Download map area by defining its bounding box - Swift SDK | Mobile sdk | Mobile sdk ios | Ios"
description: "Offline API allows you to download a rectangular area by defining its bounding box."
---

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

# Download map area by defining its bounding box - Swift SDK

The MapTiler SDK for iOS provides a powerful Offline Pack API that allows you to download a rectangular area by defining its bounding box for use without an active internet connection.

Before you begin, ensure you have followed the [iOS Getting Started with Offline Pack API](https://docs.maptiler.com/mobile-sdk/ios/examples/offline-get-started/) to set up your project and obtain your API key.

## Basic Offline Pack (Bounding Box)

```swift
import MapTilerSDK

// Define the bounding box
let bounds = MTBoundingBox(
    minLon: 8.5170, 
    minLat: 47.3500, 
    maxLon: 8.5670, 
    maxLat: 47.4000
)

// Create the region definition
let definition = MTOfflineRegionDefinition(
    geometry: .boundingBox(bounds),
    minZoom: 1,
    maxZoom: 12,
    referenceStyle: .streets
)

// Create and download the pack
Task {
    do {
        let pack = try await MTOfflinePack.createPack(region: definition)
        await pack.download()
        print("Download started for pack: \(pack.id)")
    } catch {
        print("Failed to create pack: \(error)")
    }
}
```

## Learn more

For more information browse our [API Reference](https://docs.maptiler.com/mobile-sdk/ios/api/)

Check out our [SDK Swift Examples](https://docs.maptiler.com/mobile-sdk/ios/examples/).
