Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Find a specific currency in Amatino Swift - A double-entry accounting library for iOS & MacOS
// Amatino Swift: https://github.com/amatino-code/amatino-swift
// Double entry accounting API
guard let USD: GlobalUnit = currencies.findWith(code: "USD") else {
// .findWith() returns an optional. If we end up here, Amatino
// doesn't support a currency with the supplied code.
}
// Do cool stuff with our new currency
print("Loaded a currency! Name: \(USD.name)")
@hwjeremy

This comment has been minimized.

Copy link
Owner Author

@hwjeremy hwjeremy commented Jul 19, 2018

The currencies variable referred to in this example comes from the GlobalUnitList gist

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