Last active
January 8, 2019 19:41
-
-
Save kreeger/a9f2e3c5ddebf0a30632b728ba5ae2aa to your computer and use it in GitHub Desktop.
Stack preparation code for the blog post "Flapjack" on O'Reilly's engineering blog.
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
import Flapjack | |
// Create the DataAccess object, your main point-of-entry for persistence. | |
// You can also pass in `.sql(filename: "YourCoreDataStore.sql")`. | |
let dataAccess = CoreDataAccess(name: "YourCoreDataStore", type: .memory) | |
// Then tell the stack to configure itself. | |
dataAccess.prepareStack(asynchronously: true) { error in | |
if let error = error { | |
print(error.localizedDescription) | |
} | |
// Make sure you retain your `dataAccess` variable, and now you're all | |
// ready to go! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment