Starting May 1, 2024,
Apple requires all iOS apps to include a privacy manifest.
For more information, see Privacy manifest.
Upgrade to InstantSearch iOS v9
InstantSearch iOS v9 supports Xcode 27 and the iOS 27, tvOS 27, and watchOS 27 SDKs. The InstantSearch API doesn’t change: all public types and methods keep their v8 signatures. You can upgrade without changing your code.Requirements
Because v9 accepts any
swift-protobuf 1.x release from 1.26.0,
you can use InstantSearch with packages that require a newer swift-protobuf release.
Update dependencies
- Swift Package Manager
- CocoaPods
Update your If you added InstantSearch in Xcode, set the package’s dependency rule to Up to Next Major Version from
Package.swift dependency:Swift
9.0.0.Review bug fixes
- In v8, creating a
DynamicFacetListConnectorwith acontrollerparameter crashes your app with a stack overflow. v9 fixes the crash. If you worked around it by callingconnectControllerafter you create the connector, your code keeps working. - In v8,
PaginatedDataViewModelignores errors from failed page requests. v9 logs them as errors with theInstantSearchCorelogger. This view model drivesInfiniteListand is whatHitsSearcher.paginatedDatareturns.
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
- Swift Package Manager
- CocoaPods
Update your
Package.swift dependency:Swift
Handle throwing initializers
Searcher convenience initializers that acceptappID 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.
SearchClient yourself and use the non-throwing initializer:
Swift
Remove answers and places usage
InstantSearch iOS removedAnswersSearcher 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+FilterStatePlacesSearcher,AlgoliaPlacesSearchService,Hit+Place,HitsConnector+GeoSearchIndexSegmentInteractor+AnswersSearcher
Adapt to new query types
The query parameter type has changed from the v8 client’sQuery 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 theisAutoSendingHitsViewEvents option on HitsSearcher:
Swift
Upgrade to InstantSearch iOS v5
InstantSearch v5 introduces a new architecture and new widgets, which brings several breaking changes from the previous versions:-
No
InstantSearchcomponent to automatically connecting widgets. You are now in control of theSearcherand 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 iOSUIViews. Now the core of a widget is itsInteractor. The widget’s UI is behind an interface to minimize coupling.
The InstantSearch iOS v3 documentation is available on the legacy docs page.