0

I noticed that UIDocument's methods to let the app know of a change, such as presentedItemDidChange, only get called if the app is running in the foreground.

What I'm wondering is, if the user was to switch apps or send my app to the background, how can I know if the UIDocument has changed since the user last saw it when they bring the app to the foreground again?

Or, should I be updating everything every time the app returns to the foreground just in case the UIDocument has been updated?

Anton
  • 3,998
  • 25
  • 40

1 Answers1

2

uidocument handle all of change notification by itself, so if the document changed in other devices, loadFromContents:ofType:error: will be called automatically to reflect these changes, so the only thing you need to do is to implement this method.

user1992692
  • 21
  • 1
  • 2
  • Not really. You need using NSMetadataQuery and Notification.Name.NSMetadataQueryDidUpdate to catch the update – frogcjn Jun 24 '19 at 07:46