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.
24 lines
510 B
24 lines
510 B
1 year ago
|
//
|
||
|
// PersistentThingExtension.swift
|
||
|
// JustOneThing
|
||
|
//
|
||
|
// Created by Alan Francis on 15/07/2023.
|
||
|
//
|
||
|
|
||
|
import CoreData
|
||
|
|
||
|
extension PersistentThing {
|
||
|
var asThing: Thing {
|
||
|
get {
|
||
|
Thing(text: self.text ?? "[no text]",
|
||
|
createdAt: self.createdAt ?? Date.distantPast)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static var request: NSFetchRequest<PersistentThing> {
|
||
|
get {
|
||
|
return NSFetchRequest<PersistentThing>(entityName: PersistentThing.entity().name!)
|
||
|
}
|
||
|
}
|
||
|
}
|