Skip to content

Foreverland/ANDYFetchedResultsController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

ANDYFetchedResultsController

The idea is to write this:

let fetchedResultsController = Midged.fetch(context).where("type == 'abc'").sortBy("createdDate").limit(5)
fetchedResultsController.performFetch(nil)

Instead of this:

let fetchRequest = NSFetchRequest()
fetchRequest.entity = NSEntityDescription(name: "Midged", managedObjectContext:context)
fetchRequest.predicate = NSPredicate(format: "type == 'abc'")

let sortDescriptor = NSSortDescriptor(key: "createDate", ascending: true)
fetchRequest.sortDescriptors = [sortDescriptor]
fetchRequest.fetchLimit = 5

let fetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: context, sectionNameKeyPath: nil, cacheName: nil)
fetchedResultsController.performFetch(nil)

About

NSFetchedResultsController on steroids, so far just a draft

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published