-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCachedUser+CoreDataProperties.swift
91 lines (68 loc) · 1.99 KB
/
CachedUser+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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// CachedUser+CoreDataProperties.swift
// Friendbook
//
// Created by Edwin Przeźwiecki Jr. on 04/02/2023.
//
//
import Foundation
import CoreData
extension CachedUser {
@nonobjc public class func fetchRequest() -> NSFetchRequest<CachedUser> {
return NSFetchRequest<CachedUser>(entityName: "CachedUser")
}
@NSManaged public var about: String?
@NSManaged public var address: String?
@NSManaged public var age: Int16
@NSManaged public var company: String?
@NSManaged public var email: String?
@NSManaged public var id: String?
@NSManaged public var isActive: Bool
@NSManaged public var name: String?
@NSManaged public var registered: Date?
@NSManaged public var tags: String?
@NSManaged public var friends: NSSet?
var wrappedID: String {
id ?? "Unknown ID"
}
var wrappedName: String {
name ?? "Anonymous"
}
var wrappedCompany: String {
company ?? "Unemployed"
}
var wrappedEmail: String {
email ?? "Unknown email"
}
var wrappedAddress: String {
address ?? "Unknown address"
}
var wrappedAbout: String {
about ?? "Missin bio"
}
var wrappedRegistered: Date {
registered ?? Date.now
}
var wrappedTags: String {
tags ?? "No tags"
}
var friendsArray: [CachedFriend] {
let set = friends as? Set<CachedFriend> ?? []
return set.sorted {
$0.wrappedName < $1.wrappedName
}
}
}
// MARK: Generated accessors for friends
extension CachedUser {
@objc(addFriendsObject:)
@NSManaged public func addToFriends(_ value: CachedFriend)
@objc(removeFriendsObject:)
@NSManaged public func removeFromFriends(_ value: CachedFriend)
@objc(addFriends:)
@NSManaged public func addToFriends(_ values: NSSet)
@objc(removeFriends:)
@NSManaged public func removeFromFriends(_ values: NSSet)
}
extension CachedUser : Identifiable {
}