Created
January 11, 2024 12:01
-
-
Save shaps80/11bada4db1813180a0880b6b33003168 to your computer and use it in GitHub Desktop.
Mirror: Print recursively
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 Mirror { | |
func printRecusively() { | |
for child in children { | |
let label = child.label ?? "<unknown>" | |
let value = child.value | |
print(type(of: value), label, value, separator: " | ") | |
Mirror(reflecting: value) | |
.printRecusively() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: