Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Document doesn't save if app goes to background without tapping "Done" #2

Open
louisdh opened this issue Mar 11, 2018 · 6 comments
Open
Labels
bug Something isn't working

Comments

@louisdh
Copy link
Owner

louisdh commented Mar 11, 2018

No description provided.

@louisdh louisdh added the bug Something isn't working label Mar 11, 2018
@a40yostudent
Copy link

Hi! I could not reproduce this on the App Store version. To make the edits disappear, I have to go background then swipe up the app. Is this what you mean?

@LeoNatan
Copy link

Doesn't UIDocument save opportunistically in events, such as going to background? That's how it works for NSDocument. On app termination, it should have already saved.

@a40yostudent
Copy link

from Apple documentation:

In addition to the system terminating your app, the user can terminate your app explicitly using the multitasking UI. User-initiated termination has the same effect as terminating a suspended app. The app’s process is killed and no notification is sent to the app.

I'm looking at best practices, should be something related to applicationWillResignActive:

@LeoNatan
Copy link

That's not true. You hear in the app delegate applicationWillTerminate:.

@Vercantez
Copy link

I made a fix to this bug. Starting a PR

@aamct2
Copy link

aamct2 commented Apr 10, 2018

This is probably part of a larger discussion @louisdh in terms of what is correct behaviour with regards to auto-saving for the app.

  1. Should the app ever auto-save or should that require explicit user action?
  2. If the app provides auto-save, should we implement an UndoManager and register it with the UIDocument so that we get auto-saves happening as we go for free plus the ability to add user actions for undo/redo?

My preference would be:

  1. We should generally be auto-saving. That's (relatively) common practice on iOS, especially with users jumping in an out of apps.
  2. We should implement UndoManager and add user actions for it. It makes sense as most basic text editors have this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants