Skip to content

Instantly share code, notes, and snippets.

@jlalvarez18
jlalvarez18 / deepDescription.swift
Last active June 4, 2022 12:12 — forked from mhuusko5/Swift – func deepDescription
Swift 4 – 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 {