我发现的所有关于将图像上传到 AWS S3 存储桶的教程都涉及使用 Bolts 框架。但是,现在我个人尝试遵循这些教程,我得到了编译时错误:Cannot convert value of type 'BFExecutor to expected argument type 'AWSExecutor!'
.
在这个代码块上:
transferManager.upload(uploadRequest).continueWithExecutor(BFExecutor.mainThreadExecutor(), withBlock:{ [unowned self]
task -> AnyObject in
// once the uploadmanager finishes check if there were any errors
if(task.error != nil){
NSLog("%@", task.error);
}else{ // if there aren't any then the image is uploaded!
// this is the url of the image we just uploaded
NSLog("https://s3.amazonaws.com/s3-demo-swift/foldername/image.png");
}
self.removeLoadingView()
return "all done";
})
continueWithExecutor 方法的预期参数是 AWSExecutor!和 AWSContinuationBlock!。
我的 podfile 目前有:
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'AWSS3'
pod 'AWSCore'
pod 'AWSCognito'
pod 'AWSSNS'
pod 'Parse'
pod 'Bolts'
Amazon 最近是否更改了他们的 SDK 并创建了自己的数据类型?我错过了图书馆吗?在转移过程的这一步中,我找不到任何不使用 Bolts 的来源。