Created
March 6, 2018 06:20
-
-
Save execjosh/f9efb7a66f70ed8b4d343a476a610534 to your computer and use it in GitHub Desktop.
Compatiblility shim for updating to SwiftyJSON v4.0.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftyJSON | |
public extension JSON { | |
// Compatiblility shim for updating to SwiftyJSON v4.0.0 | |
// See changes introduced by: https://github.com/SwiftyJSON/SwiftyJSON/pull/833 | |
init(data: Data) { | |
do { | |
try self.init(data: data, options: []) | |
} catch { | |
self.init(jsonObject: NSNull()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment