title: How to use AWS Rekognition to detect Image Labels and Faces in Swift 3
body: <p>So I've been trying to use the AWSRekognition SDK in order to detect faces and labels in images. However, Amazon has no Documentation on how to integrate their SDK with iOS. They have links that show how to work with Rekognition (Developer Guide) with examples only in Java and very limited.</p>
  
  <p><a href="http://docs.aws.amazon.com/rekognition/latest/dg/what-is.html" rel="nofollow noreferrer">Amazon Rekognition Developer Guide</a></p>
  
  <p>If you click on their "iOS Documentation", it takes you to the general iOS documentation page, with no signs of Rekognition in any section. </p>
  
  <p><a href="http://docs.aws.amazon.com/mobile/sdkforios/developerguide/" rel="nofollow noreferrer">AWS iOS Developer Guide</a></p>
  
  <p>I wanted to know if anyone knows how to integrate AWS Rekognition in <strong>Swift 3</strong>. How to Initialize it and make a request with an image, receiving a response with the labels. </p>
  
  <p>I already downloaded the <code>AWSRekognition.framework</code> and the <code>AWSCore.framework</code> and added them into my project. Also I have imported both of them in my <code>AppDelegate.swift</code> and initialized my AWS Credentials.</p>
  
  <pre><code>let credentialsProvider = AWSCognitoCredentialsProvider(
          regionType: AWSRegionType.usEast1,
          identityPoolId: "us-east-1_myPoolID")
  let configuration = AWSServiceConfiguration(
          region: AWSRegionType.usEast1,
          credentialsProvider: credentialsProvider)
  AWSServiceManager.default().defaultServiceConfiguration = configuration
  </code></pre>
  
  <p>Also I've tried to initialize Rekognition and build a Request:</p>
  
  <pre><code>do {
  
      let rekognitionClient:AWSRekognition = AWSRekognition(forKey: "Maybe a Key from AWS?")
  
      let request: AWSRekognitionDetectLabelsRequest = try AWSRekognitionDetectLabelsRequest(dictionary: ["image": UIImage(named:"TestImage")!, "maxLabels":3, "minConfidence":90], error: (print("error")))
      rekognitionClient.detectLabels(request) { (response:AWSRekognitionDetectLabelsResponse?, error:Error?) in
          if error == nil {
              print(response!)
          }
      }
  
  } catch {
      print("Error")
  }
  </code></pre>
  
  <p>Thanks a lot!</p>