Create a Watson image recognition app with Swift


One of the most impressive Watson cognitive analytic services is Visual Recognition. In this lab, you’ll use that service to consume an image URL, identify the image, and return a confidence score for relevant classifiers representing things such as objects, events, and settings.

For example, the Visual Recognition service recognizes the blue sky and mountain in this image and suggests that this landscape is from Yosemite National Park in the United States.

To create the application in this lab, follow these main steps:

  1. Create a simple iOS application in Swift.
  2. Instantiate the Watson SDK for iOS.
  3. Create a Watson service in Bluemix and get the key token for it.
  4. Add some lines of code in the Swift iOS application to call the Watson service.

You can see the code for the GUI for this lab in GitHub:


You need the following software:

Complete the previous lab “Create a Watson sentiment analysis app with Swift.”

Currently, the Watson Developer Cloud SDK for Swift requires a legacy version of Swift. Be sure to select the option to support Legacy Swift (Swift 2.3):