Since May 1st, 2024, Apple requires all iOS apps to include a privacy manifest.
For more details, see Privacy Manifest.
InstantSearch iOS
InstantSearch iOS is a library that helps you integrate various search interfaces with Algolia, built on top of the Swift API client. Accelerates development InstantSearch iOS provides out of the box components that work together: search box, list of results, filtering and sorting interfaces, hierarchical menu, federated search, suggestions, highlighting, loading and more. It connects to Algolia servers, performs API calls for you and automatically updates the user interface with the latest state. Manages complexity InstantSearch iOS lets you focus on the look and feel of your user interface, by handling the search-specific logic for you, and simplifying management of complex state like filters, hierarchical menus or federated search. Easy to integrate InstantSearch easily fits into existing code: It follows a strict separation of concerns, has few dependencies, and doesnβt make assumptions on how your app is built. Universal InstantSearch iOS supports the full range of Apple platforms: iPadOS, macOS, tvOS, watchOS. Build a perfect search and discovery experience for any device.
How InstantSearch works
InstantSearch iOS has been designed in such a way that you have full control of your UI. Each component respects the single responsibility principle, as well as being extendible and customizable. This gives developers the control over all aspects of building a search experience: whether itβs related to the framework, the UI or any other use case. Below is an overview of all components that you have access to:
Network requests and entities
Searcher TheSearcher
takes care of the search requests to Algolia. It abstracts the complexity of the REST API, the retry logic, the sequencing and more.
FilterState
This component takes care of keeping the state of the filters. Filters in a search experience are complex: you can have facets, numeric filters or tags. You can have conjunctive facets (AND), disjunctive facets (OR), or hierarchical facets. In short, thereβs a lot of cases to handle, and the FilterState
makes it easy to define how you want your filters to be applied, in a declarative way.
Query
This component helps you define any search API parameter that you want to add to your search requests.
Use cases
Interactors Interactors contain the business logic of a specific search element or view, as well as the UI State of this specific element or view. Most of the time, you donβt need to write your own interactors: the ones of the InstantSearch SDK are enough. Connectors These arenβt components in and of themselves, but most components have aconnect
method. This lets them establish a connection with other components and lets them react to a change happening in the connected component.
Interface adapters
Controllers Controller components play the role of an adapter to the UI element of a specific framework. For example, aTextFieldController
is an adapter for a UITextField
in iOS, and conforms to the SearchBoxController
protocol. The use of having such component is to make the library extendible: the same Interactor
can connect to any controller that implements a SearchBoxController
. In this way, if you have your own type of textField
, all you have to do is implement your own class that follows the SearchBoxController
protocol and connect it to the already defined SearchBoxInteractor
. Many controllers are available by default.
Presenters
A Presenter
component lets you control the output shown in search views.
For example, when displaying a refinement list (list of filters), a SelectableFacet
is given to you which contains the title of the facet, the count associated with this facet, and whether or not it has been selected by users.
Given this information, you are free to decide how to you want to display them in your UI.
View
TheView
components are the Apple Native components. Whether theyβre from UIKit, AppKit, or others, you can use them alongside the defined controllers to define any UI in your search experience.