Skip to main content
Starting May 1, 2024, Apple requires all iOS apps to include a privacy manifest. For more information, see Privacy manifest.

Upgrade to InstantSearch iOS v8

InstantSearch iOS v8 migrates the underlying Algolia client from v8 to the Algolia Swift API Client v9. This introduces several breaking changes.

Update dependencies

Update your Package.swift dependency:
Swift
.package(url: "https://github.com/algolia/instantsearch-ios", from: "8.0.0")

Handle throwing initializers

Searcher convenience initializers that accept appID and apiKey strings now throw errors because SearchClient(appID:apiKey:) throws in the Algolia Swift API Client v9. This applies to HitsSearcher, FacetSearcher, MultiIndexSearcher, and MultiSearcher.
let searcher = HitsSearcher(appID: "ALGOLIA_APPLICATION_ID",
                            apiKey: "ALGOLIA_API_KEY",
                            indexName: "INDEX_NAME")
Alternatively, create the SearchClient yourself and use the non-throwing initializer:
Swift
let client = try SearchClient(appID: "ALGOLIA_APPLICATION_ID",
                              apiKey: "ALGOLIA_API_KEY")
let searcher = HitsSearcher(client: client, indexName: "INDEX_NAME")

Remove answers and places usage

InstantSearch iOS removed AnswersSearcher and PlacesSearcher (including their services and connectors) because Algolia Answers and Algolia Places are no longer available. Remove code that references these types.
  • AnswersSearcher, AlgoliaAnswersSearchService, AnswersSearcher+FilterState
  • PlacesSearcher, AlgoliaPlacesSearchService, Hit+Place, HitsConnector+GeoSearch
  • IndexSegmentInteractor+AnswersSearcher

Adapt to new query types

The query parameter type has changed from the v8 client’s Query to SearchSearchParamsObject from the v9 client. If you set query parameters directly, update your code to use SearchSearchParamsObject.

Use the local Hit type

The Hit type is now defined locally in InstantSearchCore rather than being re-exported from the API client. If you reference Hit from the Algolia client module, update your imports. A SearchHit type alias for Hit<[String: AnyCodable]> is available for convenience.

Update event tracking

Starting from v7.26.2, InstantSearch makes it easier to send view events using the isAutoSendingHitsViewEvents option on HitsSearcher:
Swift
let searcher = HitsSearcher(appId: "ALGOLIA_APPLICATION_ID",
                            apiKey: "ALGOLIA_SEARCH_API_KEY",
                            index: "indexName",
                            isAutoSendingHitsViewEvents: true)
From v7.24.0 to v7.26.1, view events were sent automatically. Ensure you’re using the latest version of InstantSearch to send the required events.

Upgrade to InstantSearch iOS v5

InstantSearch v5 introduces a new architecture and new widgets, which brings several breaking changes from the previous versions:
  • No InstantSearch component to automatically connecting widgets. You are now in control of the Searcher and responsible for connecting and disconnecting it from widgets and other components.
  • Widgets are now built around an Interactor, which holds their data and business logic. In previous versions, widgets were iOS UIViews. Now the core of a widget is its interactor. The widget’s UI is behind an interface to minimize coupling.
To learn more, see:
The InstantSearch iOS v3 documentation is available on the legacy docs page.
Last modified on March 23, 2026