Swift 3 & 4 List Files in Directory

Attention: Application ID changes with every Appstart since iOS 8

do {
    let documentsURL = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
    let docs = try FileManager.default.contentsOfDirectory(at: documentsURL, includingPropertiesForKeys: [], options:  [.skipsHiddenFiles, .skipsSubdirectoryDescendants])
    let images = docs.filter{ $0.pathExtension == "xxx" }
    print(images)
} catch {
    print(error)
}