Advertisement
HXXXXJ

print Hierarchy

Apr 11th, 2019
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.31 KB | None | 0 0
  1. extension UIView {
  2.     func printSubView(){
  3.         printSubViewH(self, "")
  4.     }
  5.     private func printSubViewH(_ view: UIView, _ str: String){
  6.         print(str + view.description)
  7.         let nextstr = str + "   "
  8.         for view in view.subviews{
  9.             printSubViewH(view, nextstr)
  10.         }
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement