How to print Json Data with Format in Console
Published in
1 min readNov 22, 2018
When we work encode json and encoder that time we need to output as prettyPrinted so how can we do this !
let jsonEncoder = JSONEncoder()
jsonEncoder.outputFormatting = .prettyPrintedlet jsonObject = try? jsonEncoder.encode(carObj)
Thanks ! 😝