title: Unable to Determine Swift Version for the Following Pods Error
body: <p>I am trying to use Algolia for iOS. SWIFT_VERSION is not found for the Pod and throwing an error</p>
  <p>Disclaimer, Algolia put out a podsec that does include the SWIFT_VERSION so I am able to proceed forward  but wanted to know for the future if I run into the following error again</p>
  <p>For the old pod, I followed the instructions here</p>
  <p><a href="https://cocoapods.org/pods/InstantSearchClient" rel="nofollow noreferrer">https://cocoapods.org/pods/InstantSearchClient</a></p>
  <p>I received this error
  Unable to determine swift version for the following pods:</p>
  <p>‘InstantSearchClient-library’ does not specify a Swift version and none of the
  targets ( ‘Pods’ ) integrating it have the ‘SWIFT_VERSION’ attribute set. Please
  contact the author or set the ‘SWIFT_VERSION’ attribute in at least one of the targets that inegrate this pod</p>
  <p>StackOverflow had the following suggestions which did not work for me</p>
  <p>use a pre_install
  <a href="https://stackoverflow.com/questions/56432520/error-swift-version-5-0-is-unsupported-supported-versions-are-3-0-4-0-4-2">error: SWIFT_VERSION &#39;5.0&#39; is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target &#39;Starscream&#39;)</a></p>
  <p>set the ENV['SWIFT_VERSION'] = '5' at the top of the Podfile
  <a href="https://stackoverflow.com/questions/58691345/unable-to-determine-swift-version-for-the-following-pod-error">&#39;Unable to determine Swift version for the following pod&quot; - Error</a></p>
  <p>Set the SWIFT_VERSION in code ( I received an error message that the variable SWIFT_VERSION ) was already in use</p>
  <p>Here is my code:</p>
  <pre><code>ENV['SWIFT_VERSION'] = '5'
  
  platform :ios, '9.0'
  pod 'InstantSearchClient', '~&gt; 7.0'
  
  target 'contacts' do
  
    # Comment the next line if you don't want to use dynamic frameworks
  
    use_frameworks!
  
    project 'contacts'
  
    # Pods for contacts
  
    target 'contactsTests' do
  
      inherit! :search_paths
  
      # Pods for testing
  
    end
  
  
  
    target 'contactsUITests' do
  
      # Pods for testing
  
    end
  
  
  
  pre_install do |installer|
  
       installer.analysis_result.specifications.each do |s|
          if s.name == 'InstantSearchClient' 
              s.swift_version = '5.0'
  
          end
  
      end
  
    end
  
  end
  </code></pre>