FileManager helper 实用方法
作者:
_浅墨_ | 来源:发表于
2022-09-18 22:00 被阅读0次func fileInDocumentsDirectory(fileName: String) -> String {
return getDocumentsURL().appendingPathComponent(fileName).path
}
func getDocumentsURL() -> URL {
return FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last!
}
func fileExistsAtPath(path: String) -> Bool {
return FileManager.default.fileExists(atPath: fileInDocumentsDirectory(fileName: path))
}
本文标题:FileManager helper 实用方法
本文链接:https://www.haomeiwen.com/subject/axjuortx.html
网友评论