-
Notifications
You must be signed in to change notification settings - Fork 20
/
frc.swift
20 lines (17 loc) · 819 Bytes
/
frc.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
title: "NSFetchedResultsController"
summary: "Boilerplate for creating an NSFetchedResultsController"
platform: iOS
completion-scope: Function or Method
---
let fetchRequest = NSFetchRequest(entityName: <#T##String#>)
fetchRequest.predicate = NSPredicate(format: <#T##String#>, argumentArray: <#T##[AnyObject]?#>)
let sortDescriptor = NSSortDescriptor(key: <#T##String?#>, ascending: <#T##Bool#>)
fetchRequest.sortDescriptors = [sortDescriptor]
let fetchedResultsController = NSFetchedResultsController(fetchRequest: <#T##NSFetchRequest#>, managedObjectContext: <#T##NSManagedObjectContext#>, sectionNameKeyPath: <#T##String?#>, cacheName: <#T##String?#>)
fetchedResultsController.delegate = <#T##NSFetchedResultsControllerDelegate#>
do {
try fetchedResultsController.performFetch()
} catch {
<#code#>
}