Skip to content

Instantly share code, notes, and snippets.

@kevinjstewart
Created March 7, 2017 22:45
Show Gist options
  • Save kevinjstewart/10f09ca592dcd283ef552254394e9deb to your computer and use it in GitHub Desktop.
Save kevinjstewart/10f09ca592dcd283ef552254394e9deb to your computer and use it in GitHub Desktop.
import UIKit
extension UIView {
func printViewHeirarchy(_ indentation: Int = 0) {
for _ in 0..<indentation { print(" ", terminator: "") }
print(String(describing: self))
subviews.forEach { view in view.printViewHeirarchy(indentation + 1) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment