JSON Stringify in Swift 4
func jsonStringify(value: JSON) -> String {
let returnable = ""
if let data = try? JSONSerialization.data(withJSONObject: value, options: JSONSerialization.WritingOptions.sortedKeys) {
if let string = NSString(data: data, encoding: String.Encoding.utf8.rawValue) {
return string as String
}
}
return returnable
}