From e430723af54c2b5b95b54d4a552dc3aa19778194 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Fri, 16 Jun 2017 23:36:22 -0700 Subject: [PATCH] Deserialize interaction date as TimeInterval This fails to deserialize as an Int in Swift 3.2. --- DVR/Interaction.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DVR/Interaction.swift b/DVR/Interaction.swift index e32ae00..6554778 100644 --- a/DVR/Interaction.swift +++ b/DVR/Interaction.swift @@ -93,11 +93,11 @@ extension Interaction { init?(dictionary: [String: Any]) { guard let request = dictionary["request"] as? [String: Any], let response = dictionary["response"] as? [String: Any], - let recordedAt = dictionary["recorded_at"] as? Int else { return nil } + let recordedAt = dictionary["recorded_at"] as? TimeInterval else { return nil } self.request = NSMutableURLRequest(dictionary: request) as URLRequest self.response = HTTPURLResponse(dictionary: response) - self.recordedAt = Date(timeIntervalSince1970: TimeInterval(recordedAt)) + self.recordedAt = Date(timeIntervalSince1970: recordedAt) self.responseData = Interaction.dencodeBody(response["body"], headers: response["headers"] as? [String: String]) } }