Skip to content

Instantly share code, notes, and snippets.

@jayz5
Created August 23, 2018 02:58
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 jayz5/c4ac8ff3f9bdb67540561102592dcd49 to your computer and use it in GitHub Desktop.
Save jayz5/c4ac8ff3f9bdb67540561102592dcd49 to your computer and use it in GitHub Desktop.
func deleteDocFile(fileName: String) {
guard let docDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { return }
let fileURL = docDir.appendingPathComponent(fileName)
print("deleting file url: ", fileURL)
try? FileManager.default.removeItem(at: fileURL)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment