application iOS de notes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
notes/Notes/Model/Note+CoreDataProperties.swift

33 lines
742 B

//
// Note+CoreDataProperties.swift
// Notes
//
// Created by Laurent Morvillier on 21/09/2022.
//
//
import Foundation
import CoreData
extension Note {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Note> {
return NSFetchRequest<Note>(entityName: "Note")
}
@NSManaged public var content: String?
@NSManaged public var title: String?
@NSManaged public var lastEditDate: Date?
static func fetchByDate() throws -> [Note] {
let request = Note.fetchRequest()
request.sortDescriptors = [NSSortDescriptor(key: "lastEditDate", ascending: true)]
return try PersistenceController.shared.container.viewContext.fetch(request)
}
}
extension Note : Identifiable {
}