Post

Replies

Boosts

Views

Activity

NSDocumentController subclass with remembered document options
Hi all, I am trying to allow users of my app to select extra options when opening documents, and to remember those options when re-opening documents at launch. So far best idea I have is: Subclass NSDocumentController to provide an NSOpenPanel.accessoryView with the options Create a URL bookmark for each opened file and keep a mapping of bookmarks to options On launch and when the recent documents list changes, prune the stored mappings to match only the recent items Has anyone done this before, or know of a better approach? Thank you.
0
0
148
1w
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?
1
0
864
Jun ’21
Using SQLite with FileDocument and SwiftUI
Hi all, I've been playing with the new SwiftUI templates and am confused about using the new FileDocument API. The docs state you should use a value type and that read/write will be threaded. My app uses an SQLite database for data management. It does read/write incrementally without explicit save points. It also doesn't read the file into memory, but queries it as needed. What would be the correct way to handle this with SwiftUI? Should I fake reading the file on open and never report any changes to save? Thank you.
1
0
991
Jun ’20