Trello API Wrapper for Swift

Yuma Antoine Decaux
September 20, 2019
Hey all, it’s been a while since we’ve sent the last update,

As a blind coder, I need to create my own efficient solutions to manage and organise my projects. In normal circumstances, I would be using any of the services available for these tasks such as MS project, Jira, Assana or any web based services such as Trello. Many companies around the world rely on these tools to keep track of tasks, sprints, scrums and other organisational processes to optimise daily work routines within a team. In some ways, this is essential to avoid chaotic file directories and loosing track of important things when completing a production based project. And well, engineers, creatives, managers,athletes, designers, everyone pretty much relies on a quick to view mind map of their lives and work to go ahead.

However, none of the aforementioned solutions are geared for screen reader users such as myself. I learned it the hard way while going through an accelerator program, and I am not the kind to leave these aside, hoping that I will have some ultra-sensory capability to memorise every minute detail of a project. Yes, I have honed my memory to hold long digits, theorems, songs, lists, whatever I need to keep afloat in dynamic situations, but why couldn't I also enjoy these things?

So I set myself to the task of creating my own wrapper on my favorite platform the mac OS, and searched for any initial leads to accomplish this.

I first found hello trello (), which had started to write a wrapper in swift for the trello API. However, it was missing many components, including the essential functions for creating, modifying and deleting trello objects, and it was lacking any explanation or tutorial for getting it running, whether the process for API and tokens to get access to my user objects, or creating a connection to APNs (Apple Push Notifications) in order to receive updates from trello's webhook API. Furthermore, it was simply a set of structs, so there wasn't any reflection on how to make it accessible to the blind.

I however don't want to spit in the soup, and I would like to thank Joel Fischer who started this initiative, and helped me with a few first steps before he left for his honeymoon.

After about 2 weeks of understanding the entire trello API and converting every command to a swift version, I have now the complete wrapper coded to allow communication with trello and creating my own desktop app. The only missing feature is searching through objects via the web API. The github is available here as just the classes for now. I will push the interface version when I have added a few more robust features. The interface is not what you would expect from a trello offering, it is stripped bare of any visual candy, down to the functional for those with no sight in mind. But it shows the functionality integrated into it, such as attachments, calendars for due dates, commenting, actions performed on a selected object, preferences, avatars, etc. Trello is surprisingly complete, which is the reason I spent so much time testing each feature and adding code and classes as I discovered more lurking behind each completion, like a treadmill on blindfolds.

Design side note

When visually impaired, any space oriented interface makes no sense unless the objects on it are easily accessible, i.E a minimum amount of navigation is required to access any object on the interface. This is not the case with the standard web based trello layout, so I used a combination of standard mac OS UI controllers and some sound based cues to make the task of organising my projects easy.

I have an NSOutlineView which contains all the objects hierarchically expandable, and each type of object gives out a distinct cue (chalk on board for boards, a deck of cards shuffling for carlists, a card being dealt for single cards, a staple sound for checkItems) which play on the left field for those being explored and on the right for any manipulation being made on these same objects (create, modify, delete). I have included the latest actions on each board on the right with human friendly time stamps to find out what is going on, and what I may have missed.

To further optimise the process, I have added key command controls which are contextually activated depending which object I am sitting on (command-n on an object will create a child type object, shift command-n will create a parent object, bringing up the relevant new object window).

The hard part

The crux of the application is an efficient way of updating the data model. I started with pulling the trello server for new actions, sorting through them to check for new ones, then applying the appropriate update on the relevant objects. However, as recommended by trello, I instead opted for using my own provider server setup with Apple's remote push notification services to achieve efficient updates by checking my own server for payloads which are sent from trello webhooks to the APN servers, back to my device via a token. the cycle goes as follows:

• Object update

• Trello webhook on my server, saving the payload to an SQL database, then sending a lightweight message to APN

• APN sends my device a notification with a short identifier of the message to look for on my server

• My device sends an SQL query for the JSON payload

• The app receives the payload as an HTTP response, and updates the model on the interface

The process seems tedious, but so far delay times are minimal, under 1-2 seconds, and this seems the most appropriate way of dealing with webhooks, especially when multiple users start using the application, as trello throttles API calls.

Future development

Since working in a team requires not only setting up a schedule of tasks and annexed research material, but also communicating with others as well as updating or checking repository updates, I was considering adding a Slack and Github tab which would synchrnise with the trello tab to unify all tools into one desktop app. Adding a tag on a board or cardlist in trello will automatically add the tag and chat room to slack, create a repo and monitor it based on the trello tag when commits are pushed, which then can be reviewed an commented on.

Creative output

Writing thousands of lines of code helps to better get a grip on each object type, how they may be used and how they all associate to a contextual scenario.

I was intellectually experimenting the possibility of using trello objects for dynamic things which all have their anonymised account to change state and push information to a global view. This will require adding a 3D interface and depth, but I would imagine a water health card system to show the quality of water at different points across Queensland. Each card is attached to a district or water sampling point, given a label color, and the card can contain various objects within, even streaming video through HLS (HTTPLiveStream), cured by users. This then provides real estate agents and home buyers the opportunity to know more about the environment in which their property resides. More information can be added to these cards, which can be held by cardlists, all in a splendid 3D environment.