-
Notifications
You must be signed in to change notification settings - Fork 1
/
SingingList+CoreDataProperties.swift
54 lines (40 loc) ยท 1.27 KB
/
SingingList+CoreDataProperties.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// SingingList+CoreDataProperties.swift
//
//
// Created by Terry Koo on 2022/10/10.
//
//
import Foundation
import CoreData
extension SingingList {
@nonobjc public class func fetchRequest() -> NSFetchRequest<SingingList> {
return NSFetchRequest<SingingList>(entityName: "SingingList")
}
@NSManaged public var id: UUID?
@NSManaged public var timestamp: Date?
@NSManaged public var title: String?
@NSManaged public var singingListToSong: NSSet?
public var songArray: [Song] {
let set = singingListToSong as? Set<Song> ?? []
return set.sorted {
$0.timestamp! < $1.timestamp!
}
}
public var songCount: Int {
singingListToSong?.count ?? 0
}
}
// MARK: Generated accessors for singingListToSong
extension SingingList {
@objc(addSingingListToSongObject:)
@NSManaged public func addToSingingListToSong(_ value: Song)
@objc(removeSingingListToSongObject:)
@NSManaged public func removeFromSingingListToSong(_ value: Song)
@objc(addSingingListToSong:)
@NSManaged public func addToSingingListToSong(_ values: NSSet)
@objc(removeSingingListToSong:)
@NSManaged public func removeFromSingingListToSong(_ values: NSSet)
}
extension SingingList : Identifiable {
}