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

# Swift API overview

> The public types and methods of the Rollup SDK for iOS.

Import the `Rollup` module. Everything starts from the `Rollup` namespace and its shared client, `Rollup.shared`, which runs on the main actor.

```swift theme={null}
import Rollup

Rollup.registerBackgroundTasks()
try Rollup.configure(publishableKey: "rk_live_...", indexing: IndexOptions())

let access = await Rollup.shared.requestPhotoAccess()
for await state in Rollup.shared.indexing.states { /* ... */ }

let results = try await Rollup.shared.search("ramen in Tokyo last spring")
let answer = try await Rollup.shared.query("Where do I eat most?")
let profile = try await Rollup.shared.profile(schema: schemaData)
try await Rollup.shared.reset()
```

| Type | What it is |
| - | - |
| [`Rollup`](/reference/rollup) | Setup: `configure`, `registerBackgroundTasks`, the shared client and JSON coders. |
| [`RollupClient`](/reference/rollup#rollupclient) | `requestPhotoAccess`, `search`, `query`, `profile` and `reset`. |
| [`Indexing`](/reference/rollup#indexing) | Indexing state, its changes, `start()` and the current options. |
| [`IndexOptions`](/reference/index-options) | What to index. |
| [`IndexingState`](/reference/indexing-state) | Where indexing is. |
| [`SearchResults`](/reference/search-results) | What `search` returns. |
| [`Answer`](/reference/answer) | What `query` returns. |
| [`Profile`](/reference/profile) | What `profile` returns. |
| [`RollupError`](/reference/rollup-error) | Every error the SDK throws. |
| [`JSONValue`](/reference/json-value) | Any JSON value, for results without a fixed shape. |

## Codable results

Every public value type is `Codable` and `Sendable`, with camelCase keys. Enums encode as tagged objects, such as `{"type":"indexing","indexed":10,"total":40,"searchable":true}`. Use `Rollup.jsonEncoder` and `Rollup.jsonDecoder`, which write and read ISO 8601 dates, to pass results to a web view or another layer as JSON.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.