NolanDC
NolanDC

Reputation: 1041

Imported Framework not visible in View Controller

I'm attempting to integrate the AWS libraries with my iPhone app. I've followed this tutorial using the Frameworks route (not CocoaPods): https://github.com/aws/aws-sdk-ios#getting-started-with-swift

I've added the frameworks, created a bridging header file, and set up the "Objective-C Bridging Header" Build Setting to point to the file. My bridging header file has the following contents:

#import <AWSiOSSDKv2/AWSCore.h>
#import <AWSiOSSDKv2/S3.h>

I believe that the bridging header is set up correctly because I can reference the AWS classes in my AppDelegate. For instance, I have the following line in my AppDelegate, which raises no warnings or errors:

    var transferManager: AWSS3TransferManager?

When I put that exact same line into my ViewController, I get the following error: "Use of unresolved identifier 'AWSS3TransferManager'"

Am I missing a simple configuration? Is there any reason why the libraries would be available in the AppDelegate but not the ViewController? Unfortunately in the main AWS-Swift demo, the AWS libraries are referenced only in the AppDelegate: https://github.com/awslabs/aws-sdk-ios-samples/tree/master/SNS-MobileAnalytics-Sample/Swift/Sample_SNS_MobileAnalytics

Upvotes: 0

Views: 1433

Answers (1)

NolanDC
NolanDC

Reputation: 1041

I've discovered the answer. In the "Target Membership" section of the File Inspector, I had an extra target selected.

In this instance, I just had to uncheck "AngleSlider" and the project built successfully:

Extra Target Membership

Here's a StackOverflow post explaining what the "Target Membership" means: What is target membership in Xcode 4

Upvotes: 0

Related Questions