Use of unresolved identifier 'Client'

I’ve been trying without success to initialize my instance in Swift. It seems that the class Client is simply unknown. I added pod 'AlgoliaSearchClient', '~> 8.0' to my Podfile and followed up with pod install. I also already tried with pod update, but that doesn’t change the result.

My code:

import SwiftUI
import AlgoliaSearchClient

struct ListView: View {
    let client = Client(appID: "...", apiKey: "...")
    let index = client.index(withName: "...")

ends up with this:

xcrun swift -version gives me:

Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.6.0

My Podfile:

# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Storage'

# add pods for any other desired Firebase products

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'ProjectName' do
  # Comment the next line if you don't want to use dynamic frameworks
  # pod 'InstantSearchClient', '~> 7.0'
  pod 'AlgoliaSearchClient', '~> 8.0'
  target 'ProjectNameTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'AlgoliaSearchClient', '~> 8.0'

  target 'ProjectNameUITests' do
    # Pods for testing
    pod 'AlgoliaSearchClient', '~> 8.0'


I just saw that this repository seems to be using SearchClient instead. Is that the answer or is there a different issue?

1 Like

Hey @peter8

Yes indeed, you are right, it is a typo in the documentation that we just updated, it should be SearchClient.

Thanks a lot for pointing this out!