How Dowmload and parse an csv file in swift?

Hi there to apple community.
I am trying to download a csv file from a website to present the data in my app.but when I use the download task I don't know what to do with the response (it is a csv file)
Code Block let task = URLSession.shared.downloadTask(with: URL(string: "https://example.csv")!)
{ (url, response, error) in
   
  if error == nil
  {
     
  }
   
  else
  {
    print(error?.localizedDescription)
  }
}
task.resume()


what should I do with the response to get a parseable csv from this?
should I use another task?
the url is the download link of the file.
Thanks a lot for your help
What you do typically (see http ://swiftdeveloperblog. com/code-examples/download-file-from-a-remote-url-in-swift/):

Code Block
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Create destination URL
let documentsUrl:URL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first as URL!
let destinationFileUrl = documentsUrl.appendingPathComponent("downloadedFile.jpg")
//Create URL to the source file you want to download
let fileURL = URL(string: "https://s3.amazonaws.com/learn-swift/IMG_0001.JPG")
let sessionConfig = URLSessionConfiguration.default
let session = URLSession(configuration: sessionConfig)
let request = URLRequest(url:fileURL!)
let task = session.downloadTask(with: request) { (tempLocalUrl, response, error) in
if let tempLocalUrl = tempLocalUrl, error == nil {
if let statusCode = (response as? HTTPURLResponse)?.statusCode {
print("Successfully downloaded. Status code: \(statusCode)")
}
do {
try FileManager.default.copyItem(at: tempLocalUrl, to: destinationFileUrl)
} catch (let writeError) {
print("Error creating a file \(destinationFileUrl) : \(writeError)")
}
} else {
print("Error" )
}
}
task.resume()
}


Now that you have the file, you need to parse the CSV
How Dowmload and parse an csv file in swift?
 
 
Q