I'm using Alamofire to upload a several files to my server with separate requests at once, the file names are displayed in a tableView along with a progress bar. When the user tries to delete a file while it's uploading the tableView cell should be removed and the request should be cancelled.
I know the following code is to be used to cancel an Alamofire request:
var request: Alamofire.Request?
self.request?.cancel()
So, I tried making an array of Alamofire.Request like
var requests = [Alamofire.Request]()
And then cancelling the request according to the index.
But this doesn't seem to be the correct way because it's not working, any suggestions?
Thanks.