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
25 lines
533 B
Swift
25 lines
533 B
Swift
//
|
|
// 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
|
|
}
|
|
|
|
}
|