title: listing all files in a folder recursively with swift
body: <p>I'm learning swift and wondering what's the best way to list all files with absolute path in a directory including ones from subfolders(files only) </p>
  
  <p>I tried with following, but it seems listing all contents names even folder names without full paths.</p>
  
  <pre><code>let paths = FileManager.default.subpaths(atPath: folderPath)
      for p in paths! {
         print p
      }
  }
  </code></pre>
  
  <p>as well as </p>
  
  <p><code>let items = try fm.contentsOfDirectory(atPath: folderPath)</code></p>
  
  <p>googling didn't come out with any working methods.</p>
  
  <p>this is for macOS 10.14</p>
  
  <p>any help is appreciated!</p>
  
  <p>thanks </p>