Install Carthage and add the Watson SDK to your project

Because you will use a separate project for this application, you must again install the Carthage dependency manager and the SDK, and then add that SDK to your Xcode project.

Install the Carthage dependency manager
Use the Carthage dependency manager to install libraries that are used by your application. You can install Carthage from GitHub or use Homebrew to update it only if you use Xcode 7.x.
Important: If you previously installed the binary version of Carthage, you must delete /Library/Frameworks/CarthageKit.framework.

  1. To install Carthage from GitHub, download and run the latest release of the Carthage.pkg file: Then follow the installation prompts.
  2. To install Carthage by using Homebrew (only on Xcode 7.x), run the commands brew update and brew install Carthage.

If want to run the latest development version of Carthage, which might be highly unstable or incompatible, clone the master branch of the repository and then run the command make install.

Install the Watson SDK:

  1. Open a Bash shell in the root directory of your project.
  2. Enter cat > cartfile
  3. Enter github "watson-developer-cloud/ios-sdk"
  4. Enter a new line. Then, press control + C to exit Edit mode.
  5. From the command line at the root of the project, run the command carthage update --platform iOS. If you receive a compile failure for the framework AlamofireObjectMapper, run the command again.
    The following image shows output from the package manager as it fetches and builds iOS library components:

Add the SDK to the Xcode project:

  1. Under the project name, create a new group in your Xcode project called Framework.
  2. Navigate to the root folder of your project in Xcode and select all the framework files in the /Carthage/Build/iOS/ directory of your project (VisualRecognitionV3, Alamofire,, Freddy, RestKit, Starscream). Drag and drop those files from Finder into the new Framework group in your project in Xcode.
    Be sure you clear the option to copy items. By not copying the items, you create only a reference to those Framework files.
    This is the list of the framework libraries:
  3. In the Build Phases tab, add a new Copy Files phase and set its destination to Frameworks.
  4. For the frameworks that were added by Carthage, copy each framework individually. These are the files that you copy:
  5. Whitelist your calls to Watson services and remove the security for Whitelisting allows only specified addresses to get through without the SSL protocol.
    To do this, use either Xcode to add exceptions as shown in the following image or add the XML snippets below to your info.plist file:
    Whitelist the calls in Xcode:

    Whitelist the calls by copying the following XML to the info.plist file: