Guides / Building Search UI

What is InstantSearch iOS?

As of May 1st, 2024, Apple requires all iOS apps to include a privacy manifest. Ensure you incorporate our provided privacy manifest files into your documentation. For more details, see Privacy Manifest.

InstantSearch iOS is an open source UI library for iOS that lets you build a search interface in your frontend app.

InstantSearch focuses on enhancing your frontend with widgets that you can combine to create unique search interfaces.

InstantSearch suite includes various “flavors” to meet different development needs:

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.

Multi platform

Customizable

Components shipped in InstantSearch can easily be customised and configured, from high-level parameters to custom presentation logic. Most common search use-cases are covered with these components. Beyond those, writing your own component is as easy as implementing a single interface.

InstantSearch is a powerful tool for builders that want to stay in control.

Get started with InstantSearch iOS now.

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:

How it works

Network requests and entities

Searcher

The Searcher 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 a connect 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, a TextFieldController 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

The View 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.

Need help?

InstantSearch iOS is worked on full-time by Algolia’s JavaScript team.

Join the community

Ask questions and find answers on those following platforms.

Provide feedback

Stay up to date

Contributing?

All contributors are welcome, from casual to regular. Feel free to open a pull request.

Did you find this page helpful?