sample.swift
func getFiles(dirName: String) -> [String] {
do {
files = try fileManager.contentsOfDirectory(atPath: dirName)
} catch {
for path in files {
print(path as NSString)
}
return files
}
return files
}
以上(ㆁωㆁ*)