在Swift中获取文档目录路径

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Swift中获取文档目录路径相关的知识,希望对你有一定的参考价值。

Get Documents directory path in Swift
  1. func getDocsDir() -> String {
  2. let dirPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
  3. let docsDir = dirPaths[0] as! String
  4. return docsDir
  5. }

以上是关于在Swift中获取文档目录路径的主要内容,如果未能解决你的问题,请参考以下文章