Last active
July 17, 2018 09:37
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
session
instance used in this example may be seen in the Create Session gist