[Feature] Locations list #10

Merged
javier merged 13 commits from feature/locations-list into main 2023-04-12 16:58:28 +00:00
Showing only changes of commit 4f315d7bfb - Show all commits

View File

@ -0,0 +1,27 @@
//
// NSFetchRequest+Location.swift
// Persistence
//
// Created by Javier Cicchelli on 12/04/2023.
// Copyright © 2023 Röck+Cöde. All rights reserved.
//
import CoreData
public extension NSFetchRequest where ResultType == Location {
// MARK: Functions
static func allLocations() -> NSFetchRequest<Location> {
let request = Location.fetchRequest()
request.sortDescriptors = [
.init(keyPath: \Location.source, ascending: true),
.init(keyPath: \Location.createdAt, ascending: true)
]
request.resultType = .managedObjectResultType
return request
}
}