give id/tag to Alamofire upload request in swift

Viewed 384

Can anyone help me to give id/tag to func Alamofire upload request in Swift, I need this to update uitableview when the upload image is done or fail. This is sample from alamofire for upload:

Alamofire.upload(
.POST,
"https://httpbin.org/post",
multipartFormData: { multipartFormData in
    multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn")
    multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow")
},
encodingCompletion: { encodingResult in
    switch encodingResult {
    case .Success(let upload, _, _):
        upload.responseJSON { response in
            debugPrint(response)
        }
    case .Failure(let encodingError):
        print(encodingError)
    }
}

)

0 Answers
Related