[ad_1]
Is there a foolproof means of saving the URL of a UIDocument so an utility can resume enhancing the doc on subsequent launch?
I’ve tried varied methods of saving the URL, however typically the doc URL will barely differ from what is predicted.
For instance, the next code:
var scoresURL = FileManager.default.urls(for: .documentDirectory,
in: .userDomainMask).first!
may return this:
file:///var/cell/Containers/Information/Software/50E947C1-7A30-40A0-8BB6-1C3BB41A1218/Paperwork
However a documented loaded utilizing UIDocumentBrowserViewController may set the fileURL path of the UIDocument to this:
file:///personal/var/cell/Containers/Information/Software/50E947C1-7A30-40A0-8BB6-1C3BB41A1218/Paperwork
It’s these slight variations that make me marvel if I’m merely doing the improper factor by sustaining a MRU record.
These points seem solely on an precise machine. The simulator is paths are secure, a minimum of till the arbitrary instances the simulator decides to reset its state.
[ad_2]
