Skip to content

Instantly share code, notes, and snippets.

@zentrope
Created December 30, 2020 04:22
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 zentrope/67f8429543359a6c85268f93a093eccc to your computer and use it in GitHub Desktop.
Save zentrope/67f8429543359a6c85268f93a093eccc to your computer and use it in GitHub Desktop.
Fetch controller
func usersFetchController() -> NSFetchedResultsController<FKUser> {
let fetcher: NSFetchRequest = FKUser.fetchRequest()
fetcher.sortDescriptors = [ NSSortDescriptor(key: "id", ascending: false) ]
return NSFetchedResultsController(fetchRequest: fetcher, managedObjectContext: viewContext, sectionNameKeyPath: nil, cacheName: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment