Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWSS3TransferManagerUploadRequest in XCode 7

I upgraded to Xcode 7/Swift 2.0 today. My project is using CocoaPods and I am importing all AWS related files in the POD-file, I have set up my bridging-header and I import all the files Amazon tells me to. Before upgrading to Swift 2.0, everything AWS related was working fine (namely uploading images into an S3 bucket)

Now after upgrading, I can not create an instance of AWSS3TransferManagerUploadRequest in my project anymore. The line:

let uploadRequest = AWSS3TransferManagerUploadRequest()

produces and error.

(Use of unresolved identifier 'AWSS3TransferManagerUploadRequest')

Any ideas why this is happening? The AWSCognitoCredentialsProvider/AWSServiceConfiguration code is working fine in my AppDelegate.Swift

like image 723
schnabler Avatar asked Feb 11 '26 18:02

schnabler


1 Answers

Found a solution - Since I'm using "use_frameworks!", CocoaPods converts all pods from static libraries to framerworks.

"Normally when you’re importing Objective-C code into Swift, you do so by including the header of the file containing that code in the “Bridging Header” for your project. And that is indeed how you include code from a static library (which your pods used to be.)

But it is not how your import Objective-C code from a Framework."

So I simply added

import AWSS3

to my controller, and everything worked fine again.

Found the solution here: http://rogueleaderr.com/post/115372471213/unresolved-identifier-in-swift-when-importing

like image 97
schnabler Avatar answered Feb 13 '26 10:02

schnabler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!