Skip to content

Instantly share code, notes, and snippets.

@hwjeremy
Last active July 17, 2018 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hwjeremy/540254bc9690e6e786a9d0bbfe7f9155 to your computer and use it in GitHub Desktop.
Save hwjeremy/540254bc9690e6e786a9d0bbfe7f9155 to your computer and use it in GitHub Desktop.
Create an Entity in Amatino Swift - A double-entry accounting library for iOS & MacOS
// Amatino Swift: https://github.com/amatino-code/amatino-swift
// Double entry accounting API
try Entity.create(
session: session,
name: "Stark Industries",
callback: { (error, newEntity) in
guard error == nil else {
// Handle errors
}
// Do cool stuff with our new Entity
let starkIndustriesId = newEntity!.id
print("Created new Entity with ID: \(starkIndustriesId)")
})
@hwjeremy
Copy link
Author

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