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!.
現在、私のポッドファイルには次のものがあります。
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 を使用していないソースは見つかりません。