In my first post about our iOS version, I thought I’d get some important nuts and bolts out of the way: syncing. Scrivener for iOS syncs with the Mac and Windows versions using Dropbox. Here’s how it works:
- In the iOS version, you set up sync by tapping the sync button and then choosing to link to Dropbox (you’ll need a Dropbox account for this).
- Once you’ve linked to your Dropbox account, Scrivener will prompt you to choose a subdirectory of your Dropbox folder. Scrivener will download and sync any files you have placed into this folder on your Mac or Windows machine, and it will upload any files you create in the iOS version. Like most apps that sync with Dropbox, the default folder used for this is Dropbox/Apps/Scrivener, but you can choose any folder in Dropbox that you wish. (Just be aware that everything in the folder you select will be synced with your device, so it should be a folder you use to store only Scrivener projects.)
- Once you’re set up, any time you create a project in the iOS version, it will ask you whether you want the project stored on Dropbox or only locally.
- Any time you want to sync, you just hit the sync button anywhere it appears in the app, and Scrivener will upload all local changes to Dropbox and download all changes from Dropbox. (So you do not need to be online to work with your Dropbox projects.)
- You are free to leave the project open on your Mac or Windows machine while you use and edit it on iOS. After you sync, the changes will be detected and incorporated into the project.
Which makes the thousands of lines of code that went into this sound easy!
Note that you don’t need to sync your projects with Dropbox. If you don’t have a Dropbox account, you can transfer projects between your desktop and iOS device by copying them back and forth via iTunes.
We’ve had great feedback from beta-testers on this system, and it seems to be working brilliantly. Let’s address that elephant-shaped cloud in the room, though: iCloud. Sadly, Scrivener 1.0 for iOS will not support iCloud syncing. Part of the reason for this is that we have both Mac and Windows users, and iCloud is still much more associated with the Mac. That’s not the main reason, however: as much as we love iCloud, current limitations in and difficulties with iCloud mean that it is not at present best suited for the sort of complex, package-based file format used by Scrivener. A boring technical explanation follows…
Every Scrivener project is really a folder full of files and subfolders. This is different from most apps, which more commonly use “flat” file formats – a single text or XML file, or a zip package. This package-based format means that Scrivener doesn’t have to read into memory the entirety of a project containing a gigabyte of research materials upon opening it; Scrivener only ever reads into memory the files you are working on, and it releases them from memory if it no longer needs them or if memory usage gets too high (a particular concern on iOS). This format makes Scrivener’s unique features possible—but it’s not a format that plays well with iCloud. (iCloud does seem to have improved in this regard over the years, and Apple mentions in its documentation that it can work with file packages, but so far there is very little documentation on this beyond using very basic file packages that do not need to do the sorts of thing required by Scrivener.)
It’s not just the format itself, but how it is used. Because Scrivener projects comprise many files, it’s important that any given project is synced in its entirety and not piecemeal. If an updated binder structure is downloaded, it’s not much use if none of the new files it references are yet available, for instance. Dropbox gives us the control we need in this regard.
This is also the reason that the sync needs to be invoked manually rather than continually happening in the background. With background sync (which iCloud always uses), there is no control over which files appear when, meaning that important structural files could download without the files they refer to or vice versa. This is an even more serious problem when the connection is lost part-way through a sync. All too easily this could put a project into an inconsistent state that could wreak havoc, and we’d rather have users complaining that they don’t like manual sync than that they have just lost four hours of writing or structural changes!
I’m aware that the lack of iCloud support will be a disappointment to some users, but please rest assured that we will continue to monitor iCloud’s development. Apple are improving it all the time, and I hope that one day, when Apple enhances the frameworks and extends the documentation to more advanced uses, or perhaps if we can find a coder with expertise in this area to help me, we might be able to support it. (We’re not the only ones who have run into these problems, by the way: OmniFocus and Notebooks have had to omit iCloud sync for similar reasons.)
Right now, though, Dropbox sync is working smoothly and allows Mac and Windows users alike to work between their desktop machine and iOS devices: edit the project on your desktop, tap sync on your mobile device, make changes, tap sync again, and carry on editing on your desktop. By the end of July, you’ll be carrying your book around with you in your pocket, ready to type whenever inspiration strikes.