Amatino Swift v0.0.2 Released


#1

Originally published at: https://amatino.io/blog/amatino-swift-v0-0-2-released/

A new version of the Amatino API Swift library is available. Amatino Swift allows you to store double-entry accounting data in a Swift application, on iOS or MacOS.

v0.0.2 includes:

  • New Entity class, including create() & retrieve() methods
  • New Account class, including create() & retrieve() methods
  • New Transaction class, including create() & retrieve() methods
  • New Entry struct, with comprehensive initialisers
  • New GlobalUnit class, including retrieve() method
  • Expose Session class for use outside AmatinoAlpha instances
  • Unit tests for all of the above

Taken together, these changes allow you to interact with the Amatino API much more easily than in 0.0.1. 0.0.1 was fully dependent on the AmatinoAlpha class - A thin wrapper around HTTP requests that required you to deal with your own data encoding, and parse raw Data responses from the Amatino API.

Installation

I'm still studying the best way to distributed iOS and MacOS libraries. Right now I am leaning towards CocoaPods, and would welcome any input you might have. In the mean time, compiled libraries are available on GitHub. You are also most welcome to clone the repo and compile Amatino Swift yourself.

Example Usage

Here are some examples the new capabilities available in Amatino Swift v0.0.2:

Create a Session

This is analogous to 'logging in'. You'll notice the session is passed as a parameter throughout following examples.

Create an Entity

Entities are beings you wish to describe with accounting information. For example, a person, company, country, or project.

More...

Still to come

The majority of objects specified in the Amatino API HTTP documentation are still not available in Amatino Swift. One glaring example is the Global Unit List - How are you supposed to retrieve Global Units if you don't know which ones are available!?

Look out for v0.0.3 and onwards to add the missing pieces of the puzzle. Let me know how you want Amatino Swift to develop on Twitter or on the forums. Sign up to the Development Newsletter to be notified when new versions of Amatino Swift are available.

- Hugh