Created
June 28, 2017 12:16
-
-
Save Morbix/84556333f549ba9d065ae6947f56c5a2 to your computer and use it in GitHub Desktop.
Recursive Description
This file contains hidden or 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
func recursiveDescription(view: UIView, count: Int) { | |
let subviews = view.subviews | |
if subviews.count == 0 { | |
return | |
} | |
var tabs = "" | |
for i in 0..<count { | |
tabs = tabs+"...." | |
} | |
for subview in subviews { | |
print("\(tabs)\(subview)") | |
recursiveDescription(view: subview, count: count+1 ) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment