UIDocument Discussion - RITAccess/accessmath GitHub Wiki

Design thought. We have out ALFileManager that is handling opening and loading documents for us, then we get out data structure back and do stuff with it. Thats fine the way it is. What I want to put up for discussion is this idea.

Unified Document Opening UI

Calling on this object would guarantee that a document will be returned to you. The idea being that it will handle prompting the user to open a document, if a document is already open, returning it to you, and returning a new document if the user creates one. This way anywhere a document is opened, the UI is consistent, and document logic can stay out of our system. The API would look something like this

ALFileManager

  • defaultManager
  • currentDocumentWithCompletion: (async call)
  • currentDocument (sync call)
  • forceSave (saving will be automatic but for us ctrl-Sers out there)
  • finishedWithDocument
  • invalidateCurrentDocument Edit: remove - invalidateCurrentDocument