Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compatiblility shim for updating to SwiftyJSON v4.0.0
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
You can’t perform that action at this time.