Skip to content

Instantly share code, notes, and snippets.

/after.swift Secret

Created Feb 20, 2018
What would you like to do?
let environment = try Environment.writable(directoryURL: directoryURL)
let database: Database<String, String, Map> = try nil)
try environment.write { transaction in
for (key, value) in ["lorem": "ipsum", "dolor": "sit amet"] {
try transaction.put(value: value, forKey: key, in: database)
try { transaction in
print(try transaction.getValue(forKey: "lorem", in: database))
// Console: "ipsum"
print(try transaction.values(in: database))
// Console: ["lorem": "ipsum", "dolor": "sit amet"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.