Skip to main content
Read it from Rollup.shared.indexing.state, or follow it with Rollup.shared.indexing.states. Later versions can add states and fields, so switch with a default case.
SDK 0.3 adds preparing and unfinished, and gives indexing, ready and paused a single value: IndexingProgress or IndexSummary. Write case .indexing(let progress) where 0.2 had case .indexing(let indexed, let total, let searchable). In 0.2, indexed and total counted the current run only; now they count the whole index.

Cases

case
configure has not been called.
case
The person has not granted Photos access, or revoked it.
case
The selection was checked successfully, but no photos matched it. There is nothing to search yet. Change the window or media types, or wait for new photos.
case
The first-run models and geography are downloading. fraction runs from 0 to 1.
case
A run has started but is not indexing photos yet: it is starting, loading models or reading the library. See IndexingProgress.
case
A run is indexing photos. indexed of total covers the whole index, including earlier runs. See IndexingProgress.
case
The index holds every photo its options take. See IndexSummary.
case
No run is under way, and the index still lacks photos. reason says why. See IndexSummary.
case
Indexing is paused by indexing.pause() until indexing.resume(). See IndexSummary.
case
Indexing is blocked, or failed before anything was indexed, with a RollupError. With accessRevoked, your app’s access stopped and the index is locked. With appPendingApproval, your app is waiting for Rollup’s approval.

Properties

Bool
true when search, query and profile have an index to read: the searchable of preparing, indexing, ready, unfinished and paused.

IndexingProgress

A run under way, in preparing and indexing.
Step
What the run is doing: starting, loadingModels, readingLibrary, indexing or finishing.
Int
Photos done in the whole index. It reaches total when the run finishes.
Int
Photos the index’s options take. It is 0 until the library is read.
Double
Share of total done, from 0 to 1. It moves smoothly and never goes back during a run.
Bool
Search, query and profile work on the photos indexed so far.
Int?
While reading the library: items listed so far, of the total.
Wait?
Why progress stands still: places, textModel, people, coolingDown, retryingBatch or events.
Int
Photos this run left out, such as screen recordings. They are not in total.
Int
Photos that could not be indexed. A later run tries them again.
Double?
About how long the rest takes. nil until the pace is known.
Date?
When this run last made new photos searchable. Rerun a search on screen when it changes.
Background?
Whether the run goes on off screen: continuing, endedByIOS or processingTask. nil when it stops with the app.

IndexSummary

The index while no run is under way, in ready, unfinished and paused.
Int
Photos in the index.
Bool
Search, query and profile work on the index.
Date?
When a run last brought the index up to date. Always set for ready.
Int?
Photos the index still lacks, as the last run counted.
Int
Photos the last run left out.
Int
Photos that could not be indexed.
Int
Failed photos a later run tries again.
Bool
The library changed since the last update. With updatesAutomatically, an update runs when your app is next on screen.
Reason?
Why the index is unfinished: stopped, endedByIOS, failed, interrupted or waiting.
RollupError?
Why the last run failed, when reason is failed.
Date?
When the next automatic run may start, after a failure.
Date?
The earliest time iOS may run the requested background processing task.

Reasons

JSON

Each case encodes as one flat object: type, then the fields of its value. Fields without a value are left out, and dates are ISO 8601.