Concepts / Building Search UI / Installation
May. 10, 2019

Installation

Installing InstantSearch iOS

InstantSearch iOS can be implemented using either Cocoapods, Carthage or Swift Package Manager

Cocoapods

  • If you don’t have CocoaPods installed on your machine, open your terminal and run sudo gem install cocoapods.
  • If you don’t have a Podfile in your project, type pod init. A Podfile will be created for you.
  • Open your Podfile and add

Swift 4.2

1
2
3
4
pod 'InstantSearch', '~> 3.0'
# pod 'InstantSearch/Widgets' for access to everything
# pod 'InstantSearch/Core' for access to everything except the UI widgets
# pod 'InstantSearch/Client' for access only to the API Client

Swift 4.1

1
2
3
4
pod 'InstantSearch', '~> 2.0'
# pod 'InstantSearch/Widgets' for access to everything
# pod 'InstantSearch/Core' for access to everything except the UI widgets
# pod 'InstantSearch/Client' for access only to the API Client
  • On your terminal, run pod update.

Carthage

To install InstantSearch, simply add the following line to your Cartfile:

Swift 4.2

1
2
3
github "algolia/instantsearch-ios" ~> 3.0 # for access to everything
# github "algolia/instantsearch-core-swift" ~> 4.0 # for access to everything except the UI widgets
# github "algolia/algoliasearch-client-swift" ~> 6.0 # for access only to the API Client

Swift 4.1

1
2
3
github "algolia/instantsearch-ios" ~> 2.0 # for access to everything
# github "algolia/instantsearch-core-swift" ~> 3.0 # for access to everything except the UI widgets
# github "algolia/algoliasearch-client-swift" ~> 5.0 # for access only to the API Client

Swift Package Manager

The API client is the only library of the framework available on SwiftPM. Simply add the following line to your Package.swift:

1
.package(url:"https://github.com/algolia/algoliasearch-client-swift", from: "5.0.0")

Did you find this page helpful?