Last active
March 28, 2020 19:42
-
-
Save clbemre/3d61abc8c7f011ab78277a2f29509b4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CustomStringConvertible { | |
var description: String { | |
var desc = "Class Name: \(type(of: self))\n" | |
let mirror = Mirror(reflecting: self) | |
for child in mirror.children { | |
if let label = child.label { | |
desc.append("\(label): \(child.value)\n") | |
} | |
} | |
return desc | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment