Skip to content

Commit

Permalink
Deserialize interaction date as TimeInterval
Browse files Browse the repository at this point in the history
This fails to deserialize as an Int in Swift 3.2.
  • Loading branch information
hyperspacemark committed Jun 17, 2017
1 parent 53b2cfa commit e430723
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DVR/Interaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}

0 comments on commit e430723

Please sign in to comment.