Search code examples
uikituidocument

UIDocument saveToURL deletes original file


I'm trying to use -[UIDocument saveToURL:(NSURL *)url forSaveOperation:(UIDocumentSaveOperation)saveOperation completionHandler:(void (^ __nullable)(BOOL success))completionHandler] to save a duplicate at a new URL, however the original file -[UIDocument fileURL] is deleted when doing so?


Solution

  • I couldn't find any documentation regarding this, but it seems to be intend. ¯\_(ツ)_/¯ Here is the Hopper disassembly of iOS 15.2:

    enter image description here