[Feature] Persistence (#5)
This PR contains the work done to implement some useful protocols, classes and extensions to use to setup a persistence layer in an application. To provide further details about the work done: - [x] declared the `Persistence` target in the Package file; - [x] forgot to declare the `Communications` and `Persistence` target to the `SwiftLibs` library in the `Package` file; - [x] defined the `Service` public protocol; - [x] implemented the `Fetcher` generic class; - [x] implemented the `bitBucket` static property in the `URL+Devices` public extension; - [x] updated the `README` file. Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// NSFetchRequest+TestEntity.swift
|
||||
// PersistenceTests
|
||||
//
|
||||
// Created by Javier Cicchelli on 17/04/2023.
|
||||
// Copyright © 2023 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import CoreData
|
||||
|
||||
extension NSFetchRequest where ResultType == TestEntity {
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
static func allTestEntities() -> NSFetchRequest<TestEntity> {
|
||||
let request = TestEntity.fetchRequest()
|
||||
|
||||
request.sortDescriptors = []
|
||||
request.resultType = .managedObjectResultType
|
||||
|
||||
return request
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user