How to close the UIDocument and save data when user quits the app in Mac Catalyst

126 Views Asked by At

I have a document browser based iOS app that also works on Mac with Catalyst and there seems to be a problem with saving the document data when the user quits the app (e.g. by pressing command+q).

I am trying to close the document gracefully as soon as willResignActive() is called but that close call fails (result is false). It appears that it's too late to save the data in the app's lifecycle (periodic autosave works fine).

Have you got any ideas how to ensure that the recent changes to the document get saved?

0

There are 0 best solutions below