-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One time Index all notes in simplenote on launch
- Loading branch information
1 parent
db42b63
commit aabd303
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// NSManagedObjectContext+Simplenote.swift | ||
// Simplenote | ||
// | ||
// Created by Charlie Scheer on 4/11/24. | ||
// Copyright © 2024 Simperium. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import CoreData | ||
|
||
extension NSManagedObjectContext { | ||
@objc(fetchObjectsForEntityName: withPredicate: error:) | ||
func fetchObjects(for entityName: String, withPredicate predicate: NSPredicate) throws -> Array<NSFetchRequestResult> { | ||
let fetchRequest = NSFetchRequest<NSFetchRequestResult>() | ||
let entityDescription = NSEntityDescription.entity(forEntityName: entityName, in: self) | ||
|
||
fetchRequest.entity = entityDescription | ||
|
||
return try fetch(fetchRequest) | ||
} | ||
} |
This file contains 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