我正在尝试通过 RxAlamofire 上传文件,但 XCode 抛出错误Type of expression is ambiguous without more context
。如何解决?
RxAlamofire.upload(multipartFormData: {multipartFormData in
var i = 0
for (title, image) in images {
if let imageData = image.jpegData(compressionQuality: 0.9) {
multipartFormData.append(imageData, withName: title, fileName: "\(i).jpg", mimeType: "image/jpg")
}
i += 1
}
}, to: url, method: .post, headers: headers).responseData()
到目前为止,我不得不求助于以下拐杖: