title: Store file at public space and easily accesed by any file explorer in swift iOS
body: <p>I am trying to download one text file from the server and I have completed it.
  Also, I have stored that file but it seems like it stores at some private location and not able to access that file from other file explorer.</p>
  
  <p>Heres the code for it:</p>
  
  <pre><code> let documentsUrl =  FileManager.default.urls(for: .documentDirectory,  in: .userDomainMask).first
  //        let destinationUrl = documentsUrl!.appendingPathComponent("10xFile.pdf")
      let fileManager = FileManager.default
      do {
          let documentDirectory = try fileManager.url(for: .documentDirectory, in: .userDomainMask, appropriateFor:nil, create:false)
          let fileURL = documentDirectory.appendingPathComponent("10xFile.pdf")
  
          let dataFromURL = NSData(contentsOf: location)
          dataFromURL?.write(to: fileURL as! URL, atomically: true)
  
        } catch {
          print(error)
      }
  </code></pre>
  
  <p>But I need to access this file very easily by any other file explore.</p>
  
  <p>Thanks in advance</p>