title: list all file URLs in xCode Group
body: <p>I have a yellow folder &quot;Group&quot; name &quot;pdfs&quot; in my Xcode directory. I need to list all file URLs PDFs in the folder to list it in my view.</p>
  <pre><code>   func listDir(dir: String) {
          // Create a FileManager instance
          
          let fileManager = FileManager.default
          let documentsURL = fileManager.urls(for: .documentDirectory,
                                              in:.userDomainMask)[0].appendingPathComponent(dir)
          do {
              let fileUrls = try fileManager.contentsOfDirectory(at:documentsURL, includingPropertiesForKeys: nil)
              // process files
              print(fileUrls)
          } catch {
              print(&quot;Error while enumerating files \(documentsURL.path): \(error.localizedDescription)&quot;)
          }
  </code></pre>
  <p>I had this error</p>
  <p><strong>Error while enumerating files /Users/user/Library/Developer/CoreSimulator/Devices/EF0F4EB3-CFB0-42F0-B7F5-B36034508BA2/data/Containers/Data/Application/08019A23-FDD9-4FF8-AC1F-2C13CE293BA5/Documents/pdfs: The file “pdfs” couldn’t be opened because there is no such file.</strong></p>