So I'm importing a file in my app with UIDocumentPicker
let documentMenu = UIDocumentMenuViewController(documentTypes: ["public.xml"], in: .import)
documentMenu.modalPresentationStyle = .formSheet
documentMenu.delegate = self
present(documentMenu, animated: true)
I don't have an extension for document management or anything like that. It's an xml. I just need to parse it and show the user the result. It's not editable, nothing to be saved, etc.
In the delegate method
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
parseFor(path: url)
}
I can see the path points to a /tmp/ folder.
Printing description of url:
▿ file:///private/var/mobile/Containers/Data/Application/9C47C67D-B6F3-4E93-8239-52DCA93A6003/tmp/package.Inbox/file.kml
The question is: should I do anything about it, after the user is finished? I imagine if the file is in /tmp it will eventually get removed by the system.
Also, IF YES, how should I do it? Just save the path somewhere, and delete the file at that path?
Thanks!