Skip to content

Instantly share code, notes, and snippets.

@tad-iizuka
Created September 22, 2016 12:02
Show Gist options
  • Save tad-iizuka/ff6c4b4902e981d922d029b280e0647f to your computer and use it in GitHub Desktop.
Save tad-iizuka/ff6c4b4902e981d922d029b280e0647f to your computer and use it in GitHub Desktop.
let fetchRequest: NSFetchRequest<Staff> = Staff.fetchRequest()
if self.manager != nil {
fetchRequest.predicate = NSPredicate(format: "manager = %@", self.manager!)
}
do {
item = try (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext.fetch(fetchRequest)
} catch {
print(String(format: "Error %@: %d",#file, #line))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment