简体   繁体   中英

Do macOS Document-Based Apps Automatically Enable Collaboration?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM