Building Swift things against the Write.as API

WriteFreely Mac/iOS App: A Progress Update

It feels like it was just yesterday when I shared some initial screenshots of the WriteFreely app prototype running on iOS and Mac.

(In fact, it was almost four weeks ago.)

I've been making a lot of progress on this, and I'd love to show you where the app is today.


Pictures, Worthy of A Thousand Words

How about starting with a few screenshots? This is subject to change, but it's likely not going to change much.

"iPhones and iPad showing various screenshots of the WriteFreely app"

Above, you'll see the current version of the app, running on iPhone and iPad.

The first iPhone screenshot shows the list of posts in my Testing collection, a private blog which I'm using for —you guessed it— testing. Tapping on the < Collections navigation link at the top-left will let you choose another collection; other buttons above and below the list let you create a new local post, refresh from the server, and access settings and preferences.

Tap on any post in the list, and you'll be taken to the app's editor, as shown in the second iPhone screenshot. Any edits you make here are saved locally, and if you like, you can publish it to your WriteFreely instance.

The iPad screenshot shows the same navigation hierarchy, and like the iPhone version, it works just as you'd expect on iPadOS — a sidebar to choose the collection, a table to choose a post in the collection, and the selected post in the editor.

"The WriteFreely app running on the Mac"

Here's the app running on the Mac — the same kind of navigation, as suited to the Mac. You can more clearly see how the app's editor departs a bit from the web editor, too, with a defined area for the post's title (if you choose to add one), and another text area below for your post's content.

"The WriteFreely app in 'dark mode' on iPhone and Mac"

Oh, and of course, “dark mode” looks great. You can choose to have the app display a light scheme, a dark scheme, or to simply follow your system's setting.

Will It Post?

The basic flow of the app right now is straightforward. On launch, you're not logged in to your account, but you can create new posts that only live on your device. These posts currently show a “draft” badge, though that's going to get a less-confusing name.

As of the time of writing, the app doesn't yet store anything on disk except for your colour-scheme preference and your logged-in state, so if you quit the app —or if it crashes, which at this stage, it does every so often— you lose whatever you had. So, naturally, adding local storage is a priority.

To guard against that, you can log in to your WriteFreely account to pull in your collections and posts from the server. Those posts show up as “published”, and you can edit them, at which point the “published” badge changes to “edited”; when you're done, you can push those changes to the server, which has the “edited” badge go back to “published”.

Similarly, your local posts (the ones with the “draft” badge) can be published to your WriteFreely Drafts —see why it needs to be renamed?— at which point the badge changes to “published”.

Tapping the reload button in the post list will fetch new content from the server. Because data loss is unacceptable, the app checks to see what the last-updated timestamps are between the local and remote copies of a post, and then applies the following rules:

  1. If the local copy is unchanged and the remote copy is newer, replace the local copy with the remote copy;
  2. If the local copy has unpublished changes and the remote copy is older, discard the remote copy; and finally,
  3. If the local copy has unpublished changes and the remote copy is newer, notify the user and prompt them to make a decision:

"A portion of a screenshot warning that a newer copy of the post exists on the server."

This last bit is still under construction. Once the work is complete, you'll be able to choose which copy to keep — and of course, you'll be prompted to confirm your choice, since this will replace the local copy with the remote copy, or vice-versa.

If you log out of your account, everything is purged from the device — your collection list, your local and published posts, your logged in state, everything.

Still To Do

The easiest thing would be just link to the list of GitHub issues for the 1.0 beta — but I'm going to discuss some of the more pertinent things here, to save you a click.

Of course, saving content to your device is going to be important. There are also a couple of bugs that need fixing because they hang the app or make buttons unresponsive, so that's no good. But mostly, these to-do items fix get the user experience close to that of the WriteFreely web app.

For example — right now the app launches and drops you in the post list. It should instead drop you in the editor with a new (or recent) local post. Those local posts default to Drafts (i.e., not part of a collection), but you should be able to choose a collection for them.

Departing from other WriteFreely clients, there's an “All Posts” list which, as the name implies, shows all posts across your Drafts and your collections, all together. It doesn't, however, tell you which post belongs to which collection (neither does the editor), so that needs fixing.

And there are a few things that haven't been added as issues just yet —and maybe they won't make it into the first release— that include, off the top of my head:

We're getting closer and closer to a public beta, so that's exciting! And if you want to contribute, please don't hesitate to reach out in this forum topic!


Enter your email to subscribe to updates:

You can also subscribe via RSS or follow @angelo@write.as on Mastodon.