ICloud sync in future for iOS

Hi,

Although we don’t generally comment on future plans - mainly because plans can too easily be interpreted as promises - I can say that iCloud support is a plan for the future, but it will be some time coming and is unlikely to be part of Scrivener 3.

For a long time the technical hurdles needed to make something like Scrivener work on iCloud were too high. This is down to how Scrivener supports research features and how it is a bit of a hybrid between a “shoebox” and a “document” app. With improvements in iCloud and the Apple frameworks, however, those hurdles have largely been removed.

The problem remaining is that Scrivener was built from the ground up to work around some of those hurdles, and the way it’s built won’t play well with iCloud (or rather it won’t play with iCloud at all). Essentially - I’ll try to keep this as non-techie as possible, but it is a coding issue - when creating an app that opens “documents” (or “projects” in Scrivener’s case), the standard way of interacting with Apple’s frameworks is not to work with the files in the file system directly, but instead with a “file wrapper”. A “wrapper” is basically an abstraction in code that represents files, and which you can work with while letting Apple’s code interact with the actual file system.

It used to be the case, however, that if you tried to work with a wrapper in an app such as Scrivener, all of the data inside that wrapper would be loaded into memory as soon as the file was opened. In Scrivener’s case, this meant that if you opened a 2GB .scriv file, all 2GB would get loaded into memory immediately - ouch. And yet the whole point of Scrivener’s file format - a .scriv file is really a folder full of files - is to make it so that only the files in a project needed in a given session are loaded into memory.

The only way for me to work around this was to override, at quite a low level, file loading and saving, and to work with the file system directly so that I could ensure only the files inside the .scriv project you actually needed in a session ever got loaded.

For a long time, this wasn’t a problem - it’s a robust and stable solution. But when Apple introduced iCloud, they built it into the frameworks on the assumption that apps such as Scrivener were working with file wrapper abstractions and not working with the file system directly. This is why Scrivener cannot work with iCloud.

At some point not too long ago, the issues with file wrapper loading got fixed in the Apple frameworks, so that now it is possible to have something like Scrivener sync with iCloud (if you have a lot of large research files, you could run into issues, but that’s caveat emptor). However, the current version of Scrivener is built to work with the file system directly, meaning it can’t sync with iCloud, and this isn’t something that can just be patched - the way it works with files is woven into the very fabric of the app, with the project load/save code being the foundations most of the edifice is built upon (forgive the mixed metaphors).

So here’s the crux: we plan to support iCloud in a future version, and it is possible these days, but the only way we can do so is with a fundamental rewrite - perhaps even starting again. So that’s why it won’t be coming any time soon. :slight_smile:

All the best,
Keith

18 Likes