Is there any dump() like function returns a string?
<p>I like Swift's dump() function like this,</p>

<pre><code>class MyClass {
    let a = "Hello"
    let b = "Bye!"
    init() {}
}
let myClass = MyClass()

dump(myClass) // Printed out these lines to Xcode's console
/*
 ▿ MyClass #0
 - a: Hello
 - b: Bye!
 */
</code></pre>

<p>But dump() doesn't return a string. It just prints out to the console, and returns 1st parameter itself.</p>

<pre><code> public func dump&lt;T&gt;(x: T, name: String? = default, indent: Int = default, maxDepth: Int = default, maxItems: Int = default) -&gt; T
</code></pre>

<p>Is there any dump() like function returns a string?</p>