顯示具有 Swift 標籤的文章。 顯示所有文章
顯示具有 Swift 標籤的文章。 顯示所有文章

2021年3月13日 星期六

[Swift]取得檔案夾下的所有檔案名稱

透過以下方式可以取得FileManager搜尋程式中的檔案


let manager = FileManager.default

let urlForDocument = manager.urls(for: .documentDirectory, in:.userDomainMask)

let finalurl = urlForDocument.first! as URL

let contentsOfPath = try? manager.contentsOfDirectory(atPath: finalurl.path)

print("contentsOfPath: \(contentsOfPath)")




此段程式搜尋.documentDirectory,也可以搜尋程式下的.libraryDirectory

Privacy Policy-雙五角測驗

   『 Privacy Policy 』 ichizawa built the 雙五角測驗 app as a Free app. This SERVICE is provided by ichizawa  it will not collect any of your pers...