Skip to content

Instantly share code, notes, and snippets.

Last active July 19, 2018 03:43
What would you like to do?
Retrieve available currencies in Amatino Swift - A double-entry accounting library for iOS & MacOS
// Amatino Swift:
// Double entry accounting API
try GlobalUnitList.retrieve(
session: session,
callback: { (error: Error?, units: GlobalUnitsList?) in
guard error == nil else {
// Handle errors
guard currencies: GlobalUnitList = units else {
// Should never happen, but accidentally
// unwrapping nil angers the startup gods
// Do cool stuff with our shiny currency list
print("Retrieved \(currencies.count) currencies")
Copy link

hwjeremy commented Jul 19, 2018

The session instance used in this example may be seen in the Create Session gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment