-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountry+CoreDataProperties.swift
More file actions
59 lines (42 loc) · 1.23 KB
/
Country+CoreDataProperties.swift
File metadata and controls
59 lines (42 loc) · 1.23 KB
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
55
56
57
58
59
//
// Country+CoreDataProperties.swift
// CoreDataProject
//
// Created by Edwin Przeźwiecki Jr. on 31/01/2023.
//
//
import Foundation
import CoreData
extension Country {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Country> {
return NSFetchRequest<Country>(entityName: "Country")
}
@NSManaged public var fullName: String?
@NSManaged public var shortName: String?
@NSManaged public var candy: NSSet?
public var wrappedShortName: String {
shortName ?? "Unknown Country"
}
public var wrappedFullName: String {
fullName ?? "Uknown Country"
}
public var candyArray: [Candy] {
let set = candy as? Set<Candy> ?? []
return set.sorted {
$0.wrappedName < $1.wrappedName
}
}
}
// MARK: Generated accessors for candy
extension Country {
@objc(addCandyObject:)
@NSManaged public func addToCandy(_ value: Candy)
@objc(removeCandyObject:)
@NSManaged public func removeFromCandy(_ value: Candy)
@objc(addCandy:)
@NSManaged public func addToCandy(_ values: NSSet)
@objc(removeCandy:)
@NSManaged public func removeFromCandy(_ values: NSSet)
}
extension Country : Identifiable {
}