Get swifty
This commit is contained in:
@@ -93,16 +93,13 @@ enum Serialized
|
||||
|
||||
init?(xpc dict: xpc_object_t)
|
||||
{
|
||||
guard let g: String = dict["guid"] else { return nil }
|
||||
guard let d = XPCDictionary(dict), let g: String = d["guid"] else { return nil }
|
||||
|
||||
let dn: String? = dict["display_name"]
|
||||
let lmp: String? = dict["last_message_preview"]
|
||||
|
||||
let names: [String] = dict["participants"] ?? []
|
||||
|
||||
let unread: Int = dict["unread_count"] ?? 0
|
||||
|
||||
let dt: Date = dict["date"] ?? Date(timeIntervalSince1970: 0)
|
||||
let dn: String? = d["display_name"]
|
||||
let lmp: String? = d["last_message_preview"]
|
||||
let names: [String] = d["participants"] ?? []
|
||||
let unread: Int = d["unread_count"] ?? 0
|
||||
let dt: Date = d["date"] ?? Date(timeIntervalSince1970: 0)
|
||||
|
||||
self.guid = g
|
||||
self.displayName = dn
|
||||
@@ -122,16 +119,16 @@ enum Serialized
|
||||
|
||||
init?(xpc dict: xpc_object_t)
|
||||
{
|
||||
guard let g: String = dict["id"] else { return nil }
|
||||
guard let d = XPCDictionary(dict), let g: String = d["id"] else { return nil }
|
||||
|
||||
let s: String = dict["sender"] ?? ""
|
||||
let t: String = dict["text"] ?? ""
|
||||
let d: Date = dict["date"] ?? Date(timeIntervalSince1970: 0)
|
||||
let s: String = d["sender"] ?? ""
|
||||
let t: String = d["text"] ?? ""
|
||||
let dd: Date = d["date"] ?? Date(timeIntervalSince1970: 0)
|
||||
|
||||
self.guid = g
|
||||
self.sender = s
|
||||
self.text = t
|
||||
self.date = d
|
||||
self.date = dd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user