title: Is there a better way to "Pretty Print" the json string than I'm using
body: <p>I have json data comes server side.</p>
  
  <p>In case I use the next code I get not pretty printed one line string:</p>
  
  <pre><code>print(String(bytes: jsonData, encoding: String.Encoding.utf8))
  </code></pre>
  
  <p>To make it pretty printed I use the next code:</p>
  
  <pre><code>if let json = try? JSONSerialization.jsonObject(with: jsonData, options: .mutableContainers) {
     if let prettyPrintedData = try? JSONSerialization.data(withJSONObject: json, options: .prettyPrinted) {
        print(String(bytes: prettyPrintedData, encoding: String.Encoding.utf8) ?? "NIL")
     }
  }
  </code></pre>
  
  <p>But seems that it isn't the best way.</p>
  
  <p>So does anybody know how to pretty print incoming jsonData to print it?</p>