Is it OK to use UIDocument for a shoebox-style app?

I have an existing app which uses a JSON-based file format currently saved to Application Support (so not user visible). It only needs a single data store per-user.

I would like to integrate it with iCloud to make this file available on other devices.

Is it considered acceptable to use UIDocument on its own for loading/saving the single file?

By this I mean without using UIDocumentBrowserViewController or another file picker. Just my app loading right into the main UI but using UIDocument to open/read/save/close the data file.

I am hoping this would allow me to let UIDocument do most of the boilerplate work around NSFileCoordinator and NSFilePresenter.

Can anyone confirm if this is a thing that is known to be OK? Or am I going against the frameworks here?

Replies

I've done this for at least one app and had no problems. One main purpose of UIDocument is to facilitate multiple user-perceived files, of course, but there's no harm in using it simply to store a single file in the app's ubiquitous storage that you manage for the user. (The only real disadvantage I've hit is the inability to interact with the document from watchOS.)