2

I am looking to build a document-based app on macOS using Xcode and targeting macOS High Sierra.

Does NSDocument provide document collaboration similar to that of Pages? Apple's Document Based Apps page suggests that collaboration is a feature of proper document based apps, but I haven't seen a definitive answer to this question.

Jake3231
  • 703
  • 8
  • 22
  • Did you find the answer? – Vitalii Vashchenko Jan 30 '18 at 14:48
  • @VitaliyVashchenko I have not yet found the answer. – Jake3231 Jan 31 '18 at 17:52
  • I'm working on this task right now. And I know this: you must enable iCloud for your NSDocument subclass. When I did it, I no longer have crash while choosing 'Add people' item in macOS High Sierra automatic sharing menu. I'll keep working on, but try to watch 'What's new in Cocoa' session from WWDC 2017. There's very little info on this subject there. But at least it's something. – Vitalii Vashchenko Feb 02 '18 at 02:37

1 Answers1

3

Finaly, I found the way through the Apple's outdated documentation (which already looks like an abandoned orphan) by simply watching WWDC sessions I didn't watch yet. And I can point you to the answer to your question, since I was looking it too.

The answer is no, NSDocument or UIDocument classes don't provide collaboration mechanics as in Pages or Notes. All the NSDocument sharing method do is provides you with the sharing UI. But it's your job to implement collaboration and UI reactions to shared user actions.

Fortunately, since the release of the macOS Sierra SDK it's not an extremely hard task to do. I mean, it's still not a peace of cake or something but since Sierra and iOS 10 we have the SKShare classes in CloudKit framework. That's how we can provide collaboration in our apps. And that's how Apple implemented it in its apps.

Just watch the session 226 from WWDC 2016 and you will get ideas behind collaboration implementation and even some code samples. It's an extremely useful session on this matter.

Vitalii Vashchenko
  • 1,777
  • 1
  • 13
  • 23
  • 1
    When I get to know that it became obvious that instead of 'NSDocument collaboration' which get me nothing I had to google something like this 'CloudKit sharing'. And there's tons of examples and discussions out there. – Vitalii Vashchenko Feb 22 '18 at 23:29