Following my program shows contents of Documents directory and is displayed in a tableView . But the Documents directory contains some directories , some audio , some video , an
Updated Evdzhan's answer for Swift 4.0:
//
// Check if NSURL is a directory
//
func fileIsDir(fileURL: NSURL) -> Bool {
var isDir: ObjCBool = false;
FileManager.default.fileExists(atPath: fileURL.path!, isDirectory: &isDir)
return isDir.boolValue
}
//
// Check if a path is a directory
//
func fileIsDir(path: String) -> Bool {
var isDir: ObjCBool = false;
FileManager.default.fileExists(atPath: path, isDirectory: &isDir)
return isDir.boolValue
}