0
我有點困惑如何使用斯威夫特3.以前完成處理,在雨燕2.2,我有這樣的代碼:CompletionHandler斯威夫特3
transferUtility.uploadFile(tmpFileURL, bucket: bucket, key: key, contentType: contentType, expression: nil, completionHander: { (task, error) in
self.uploadCompletionHandler(task, transferError: error)
})
我如何端口這斯威夫特3?
我得到一個錯誤,指出Cannot convert value of type '(AWSS3TransferUtilityUploadTask, NSError) ->()' to expected argument type 'AWSS3TransferUtilityUploadCompletionHandlerBlock?'
有誰知道什麼地方出錯了?
它是'FUNC uploadFile開(_ fileURL:URL,桶:字符串,鍵:字符串,則contentType:字符串,表達式:AWSS3TransferUtilityUploadExpression ?, completionHander completionHandler:AWSS3.AWSS3TransferUtilityUploadCompletionHandlerBlock =無) - > AWSTask' –
hockeybro
這裏是'AWS3TransferUtilityUploadCompletionHandlerBlock':'公開的typealias AWSS3TransferUtilityUploadCompletionHandlerBlock =(AWSS3TransferUtilityUploadTask,Error?) - > Swift.Void ' – hockeybro
'嘗試'(任務,錯誤?)' –