Skip to content

Instantly share code, notes, and snippets.

@mediter
Created May 20, 2018 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mediter/3806df442d51f8692689e8d4de0e60bb to your computer and use it in GitHub Desktop.
Save mediter/3806df442d51f8692689e8d4de0e60bb to your computer and use it in GitHub Desktop.
[App Document Directory] #swift #persistence
// MARK: - Data Persistence
func documentsDirectory() -> URL {
let paths = FileManager.default.urls(for: .documentDirectory,
in: .userDomainMask)
return paths[0]
}
func dataFilePath() -> URL {
return documentsDirectory().appendingPathComponent("Checklists.plist")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment