Skip to content

Instantly share code, notes, and snippets.

@tonisuter
Created September 12, 2016 14:52
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 tonisuter/c8b4a7d53c9a6fd51782def3272eb57e to your computer and use it in GitHub Desktop.
Save tonisuter/c8b4a7d53c9a6fd51782def3272eb57e to your computer and use it in GitHub Desktop.
let fetchRequest: NSFetchRequest<MemoryPair> = MemoryPair.fetchRequest()
fetchRequest.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]
do {
let pairs: [MemoryPair] = try coreDataStack.context.fetch(fetchRequest)
// display the memory pairs
} catch {
print(error)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment