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.
33 lines
715 B
33 lines
715 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 AppDelegate.viewContext.fetch(request)
|
|
}
|
|
|
|
}
|
|
|
|
extension Note : Identifiable {
|
|
|
|
}
|
|
|