Skip to content

Commit

Permalink
Use Swift 3.0 API for NSJSONSerialization
Browse files Browse the repository at this point in the history
  • Loading branch information
neonichu committed Apr 21, 2016
1 parent 42d2560 commit 3ba0d1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ public class Client {
private func handleJSON<T: Decodable>(data: NSData, _ completion: Result<T> -> Void) {
do {
#if os(Linux)
let json = bridge(try NSJSONSerialization.JSONObjectWithData(data, options: []) as! [String : Any])
let json = bridge(try NSJSONSerialization.jsonObject(with: data, options: []) as! [String : Any])
#else
let json = try NSJSONSerialization.JSONObjectWithData(data, options: [])
let json = try NSJSONSerialization.jsonObject(with: data, options: [])
if let json = json as? NSDictionary { json.client = self }
#endif

Expand Down

0 comments on commit 3ba0d1f

Please sign in to comment.