swift 的字典在xcode中直接打印看起來很費勁 我只想要json 原始的樣子
寫一個分類就ok了?
下面這段直接粘貼然后 對字典和數(shù)組 po 調(diào)這個方法就Ok 了?

extension Dictionary {
? ? func jsonPrint() {
? ? ? ? let ff =try! JSONSerialization.data(withJSONObject:self, options: [])
? ? ? ? let str =String(data:ff, encoding: .utf8)
? ? ? ? print(str!)
? ? }
}
extension Array {
? ? func jsonPrint() {
? ? ? ? let ff =try! JSONSerialization.data(withJSONObject:self, options: [])
? ? ? ? let str =String(data:ff, encoding: .utf8)
? ? ? ? print(str!)
? ? }
}