Skip to content

Instantly share code, notes, and snippets.

@mhuusko5
mhuusko5 / Swift – func deepDescription
Last active November 3, 2022 16:26
Swift – func deepDescription(any: Any) -> String (pretty print any object, recursively)
func deepDescription(any: Any) -> String {
guard let any = deepUnwrap(any) else {
return "nil"
}
if any is Void {
return "Void"
}
if let int = any as? Int {