Created
April 19, 2019 14:16
-
-
Save artembolotov/bfa903a2bab9382e7c22ca7f3ae3eef0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
lazy var fetchedResultsController: NSFetchedResultsController<Event> = { | |
let request: NSFetchRequest<Event> = Event.fetchRequest() | |
request.fetchBatchSize = 20 | |
request.sortDescriptors = [NSSortDescriptor(key: "registered", ascending: false)] | |
let controller = NSFetchedResultsController(fetchRequest: request, managedObjectContext: | |
CoreDataStack.viewContext, sectionNameKeyPath: #keyPath(Event.sectionKey), cacheName: nil) | |
controller.delegate = self | |
try! controller.performFetch() | |
return controller | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment