Skip to content

Instantly share code, notes, and snippets.

@Morbix
Created June 28, 2017 12:16
Show Gist options
  • Save Morbix/84556333f549ba9d065ae6947f56c5a2 to your computer and use it in GitHub Desktop.
Save Morbix/84556333f549ba9d065ae6947f56c5a2 to your computer and use it in GitHub Desktop.
Recursive Description
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