-
Notifications
You must be signed in to change notification settings - Fork 0
/
ManagedObject.swift
36 lines (22 loc) · 1.24 KB
/
ManagedObject.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Created by David Spooner
*/
import CoreData
/// ManagedObject is the base class of NSManagedObject which supports model generation and ingestion through managed property wrappers.
open class ManagedObject : NSManagedObject
{
open class var declaredPropertiesByName : [String: Property]
{ [:] }
/// Return the name of the defined entity.
public class var entityName : String
{ "\(Self.self)" }
/// This method is used to determine whether or not the corresponding NSEntityDescription should be marked abstract, and should only be overridden in classes intended to be abstract by returning their concrete type. The default implementation returns ManagedObject.
open class var abstractClass : ManagedObject.Type
{ ManagedObject.self }
/// Return true iff the receiver is intended to represent an abstract entity.
public class var isAbstract : Bool
{ Self.self == abstractClass }
/// Override init(entity:insertInto:) to be 'required' in order to create instances from class objects. This method is not intended to be overidden.
public required override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?)
{ super.init(entity: entity, insertInto: context) }
}