title: How to save a POST request response as a PDF file persistently such that user may open it from outside the app later in iOS app?
body: <p>I'm working on an iOS application. In the app, I am using Alamofire to create a POST request that returns a raw PDF file in response. Right now, I am able to save the file and open it with <code>UIDocumentInteractionController</code>. But, I want the file to stay in User's documents folder.
  Here's how I create the destination path:</p>
  <pre><code>let destination: DownloadRequest.DownloadFileDestination = { _, _ in 
      let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
      let fileURL = documentsURL.appendingPathComponent(&quot;Dividend Summary Report.pdf&quot;)
      return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
  }
  </code></pre>
  <p>Someone please tell me what's wrong with my logic and what I can do to correct it.</p>