Front-End Web & Mobile

How to Switch from Single to Multiple Frameworks of the AWS SDK for iOS

Version 2 of the AWS Mobile SDK

  • This article and sample apply to Version 1 of the AWS Mobile SDK. If you are building new apps, we recommend you use Version 2. For details, please visit the AWS Mobile SDK page.
  • This content is being maintained for historical reference.

Early versions of the AWS SDK for iOS contained a single framework that contained the classes for all SDK supported services. The SDK now includes multiple frameworks, a base platform framework and individual service frameworks. For more details about the frameworks, see this post.

Switching an existing project from using the single framework to using multiple frameworks can be done easily with the following steps:

  • Open your existing project in Xcode.
  • Remove the AWSiOSSDK.framework from your project.

    1. Select the AWSiOSSDK.framework file. This file may be in the Frameworks group within your project.
    2. Control or right-click AWSiOSSDK.framework.
    3. In the popup menu that appears, click Delete.
    4. Select the Remove Reference option.
    5. Go to your project’s Build Settings and select the Framework Search Paths setting.
    6. Remove those paths that point to the old AWSiOSSDK.framework.
  • Add the appropriate frameworks to your project.

    1. Within the Project Navigator select Frameworks or another group where you wish to place your includes frameworks.
    2. Control or right-click Frameworks.
    3. In the popup menu that appears, click Add Files to “your-project-name“….
    4. Browse to the AWS SDK for iOS directory, select the desired framework, and click Add.
    5. Repeat these steps for each service utilized in your app. Note that you always need to add the AWSRuntime.framework to your project.
  • Updating the imports

    1. Individual service imports can be converted to individual or multiple frameworks as follows:

      #import <AWSiOSSDK/S3/AmazonS3Client.h>
        →  #import <AWSS3/AWSS3.h>
      #import <AWSiOSSDK/SimpleDB/AmazonSimpleDBClient.h>
        →  #import <AWSSimpleDB/AWSSimpleDB.h>
      #import <AWSiOSSDK/SQS/AmazonSQSClient.h>
        →  #import <AWSSQS/AWSSQS.h>
      #import <AWSiOSSDK/SNS/AmazonSNSClient.h>
        →  #import <AWSSNS/AWSSNS.h>
      #import <AWSiOSSDK/CloudWatch/AmazonCloudWatchClient.h>
        →  #import <AWSCloudWatch/AWSCloudWatch.h>
      #import <AWSiOSSDK/EC2/AmazonEC2Client.h>
        →  #import <AWSEC2/AWSEC2.h>
      #import <AWSiOSSDK/SES/AmazonSESClient.h>
        →  #import <AWSSES/AWSSES.h>
      #import <AWSiOSSDK/AutoScaling/AmazonAutoScalingClient.h>
        →  #import <AWSAutoScaling/AWSAutoScaling.h>
      #import <AWSiOSSDK/ElasticLoadBalancing/AmazonElasticLoadBalancingClient.h>
        →  #import <AWSElasticLoadBalancing/AWSElasticLoadBalancing.h>
      #import <AWSiOSSDK/DynamoDB/AmazonDynamoDBClient.h>
        →  #import <AWSDynamoDB/AWSDynamoDB.h>
      #import <AWSiOSSDK/STS/AmazonSecurityTokenServiceClient.h>
        →  #import <AWSSecurityTokenService/AWSSecurityTokenService.h>
    2. General SDK imports, for logging or other utilities can be converted to a single import (#import <AWSRuntime/AWSRuntime.h>). For example:

      #import <AWSiOSSDK/AmazonLogger.h>
        →  #import <AWSRuntime/AWSRuntime.h>
      #import <AWSiOSSDK/AmazonEndpoints.h>
        →  #import <AWSRuntime/AWSRuntime.h>
      #import <AWSiOSSDK/AmazonServiceResponse.h>
        →  #import <AWSRuntime/AWSRuntime.h>

Summary

Please let us know if this helped by leaving a comment below.

If you like building mobile applications that use cloud services our customers use on a daily basis, perhaps you would like to join the AWS Mobile SDK and Tools team. We are hiring Software Developers, Web Developers, and Product Managers.