📜  stringify json swift - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:03.608000             🧑  作者: Mango

代码示例1
do {
        let arrJson = try JSONSerialization.data(withJSONObject: dataAddress, options: JSONSerialization.WritingOptions.prettyPrinted)
        let string = String(data: arrJson, encoding: String.Encoding(rawValue: String.Encoding.utf8.rawValue))
        let tempJson = string! as String
        print("%%%%%%",tempJson)
    }catch let error as NSError{
        print(error.description)
    }