---
title: "Raw map API"
description: "Use SeatLayerView, SeatLayerConfiguration, async commands, and delegate events from the preserved raw-map surface in iOS 0.3.4."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.seatlayer.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Raw map API

This page covers the preserved raw-map API in the iOS `v0.3.4` tag.

## Core types

| Type | Responsibility |
| --- | --- |
| `SeatLayerView` | `UIView` map host, load lifecycle, and async commands |
| `SeatLayerConfiguration` | Event, locale, currency, selection rules, credential provider, and timeouts |
| `SeatLayerViewDelegate` | Typed readiness and SDK events |
| `BuyerAccessTokenProvider` | `@Sendable` async closure that renews private buyer access |
| `HoldResult` | Opaque hold ID, server expiry, selected seats, and display line items |
| `SeatLayerError` | Typed load, access, timeout, compatibility, and command failures |

## Configuration

```swift
var configuration = SeatLayerConfiguration(
    event: "ev_your_event_key",
    maxSelection: 6,
    locale: "en",
    currency: "USD",
    colorblindSafe: false
)

configuration.buyerAccessTokenProvider = { context in
    try await buyerBackend.mintSeatLayerAccess(reason: context.reason)
}
```

The provider returns `BuyerAccessToken(token:expiresAt:)`. Tokens remain in
memory and do not belong in URLs, logs, analytics, or persistent
storage.

Mint the native buyer-access session on your backend through
[buyer access sessions](/server-api/buyer-access-sessions), return only its
short-lived token, and treat SDK access details as opaque. See the
[tagged configuration source](https://github.com/seatlayer/seatlayer-ios/blob/v0.3.4/Sources/SeatLayer/SeatLayerConfiguration.swift)
for every field in `0.3.4`: identity/access, selection policy, locale/messages,
currency, view mode, deadlines, host diagnostics, and development overrides.

## Load and readiness

```swift
seatMap.delegate = self

do {
    let info = try await seatMap.load(configuration)
    switch info.mode {
    case .test: showTestMode()
    case .live: break
    default: break
    }
} catch {
    showLoadError(error)
}
```

Await readiness before sending a command. A failed command throws at its own
call site; an out-of-band SDK failure reaches the delegate.

## Common command groups

This is a task map, not an exhaustive replacement for the tagged declarations.

| Group | Methods |
| --- | --- |
| Read | `getSelection`, `getSelectionValidity`, `getCurrentHold`, `getGAAreas`, `getFloors`, `getViewMode` |
| Select | `selectObjects`, `deselectObjects`, `clearSelection`, `selectCategories`, `deselectCategories`, `setSelectableObjects`, `setMaxSelection`, `setSeatTier` |
| Hold | `hold`, `resumeHold`, `extendHold`, `release`, `releaseLabels`, `bestAvailable`, `holdGA` |
| Access | `refreshAccess` |
| Map | `setFloor`, `setColorblindSafe`, `setViewMode`, `zoomIn`, `zoomOut`, `zoomToFit` |
| Session | `destroy` |

Use the
[tagged `SeatLayerView` API](https://github.com/seatlayer/seatlayer-ios/blob/v0.3.4/Sources/SeatLayer/SeatLayerView.swift)
for exact labels, return types, and all methods. Use reported SDK capabilities
to decide whether to show an optional control.

Capability failures are typed. Do not show a native control merely because a
method exists; use the reported capability information and handle unsupported
commands deliberately.

## Delegate model

Implement the `SeatLayerViewDelegate` methods your screen needs. Important
event families are:

- chart ready and structured error;
- complete current selection and selection validity;
- buyer-access expiry or unavailability;
- hold changed, restored, or expired;
- general-admission area tap and seat hover;
- selected inventory becoming unavailable; and
- unknown future event.

Unknown values remain inspectable so an additive SDK event does not crash an
older binary.

Exact signatures include:

```swift
func seatLayerView(
    _ view: SeatLayerView,
    selectionDidChange seats: [SelectedSeat]
)

func seatLayerView(
    _ view: SeatLayerView,
    selectionValidityDidChange validity: SelectionValidity
)

func seatLayerViewHoldDidExpire(_ view: SeatLayerView)

func seatLayerView(
    _ view: SeatLayerView,
    didFailWith error: SeatLayerError
)
```

Selection callbacks carry complete replacement state. Hold expiry is
authoritative, and `didFailWith` is for out-of-band failure; awaited commands
throw at their own call site. The
[tagged delegate declaration](https://github.com/seatlayer/seatlayer-ios/blob/v0.3.4/Sources/SeatLayer/SeatLayerViewDelegate.swift)
lists every event and payload.

## Restore a checkout

```swift
if let restored = try await seatMap.resumeHold(holdId: persistedHoldId) {
    updateCheckoutExpiry(restored.expiresAt)
} else {
    returnBuyerToSelection()
}
```

Persist a hold ID only when your product promises checkout restoration. Never
log it, and never infer that a hold still exists from a local countdown.

## SwiftUI wrapper boundary

When intentionally using the raw map from SwiftUI, one `UIViewRepresentable`
owns the `SeatLayerView` and delegate coordinator. Updating unrelated SwiftUI
state must not recreate the map. Most SwiftUI applications should use the
complete `SeatLayerPicker` or `SeatLayerPickerScope` instead.

## Related pages

- [iOS SDK overview](/buyer-sdk/ios)
- [SwiftUI and UIKit native picker](/buyer-sdk/ios/native-picker)
- [Holds and checkout](/buyer-sdk/holds-and-checkout)
- [Lifecycle and foreground recovery](/buyer-sdk/ios#lifecycle-and-recovery)
- [Shared troubleshooting matrix](/buyer-sdk/mobile#troubleshooting)
- [Tagged UIKit example](https://github.com/seatlayer/seatlayer-ios/tree/v0.3.4/Example)
- [Tagged changelog](https://github.com/seatlayer/seatlayer-ios/blob/v0.3.4/CHANGELOG.md)

Source: https://docs.seatlayer.io/buyer-sdk/ios/raw-map/index.mdx
