0
2

More than 5 years have passed since last update.

Swiftで指定ディレクトリ内のファイル一覧取得(メモ)

Posted at
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
    }

以上(ㆁωㆁ*)

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2