Skip to content

Instantly share code, notes, and snippets.

@hammadzz
Created March 16, 2017 19:12
Show Gist options
  • Save hammadzz/14b04c656109bf3db419f38885afc0e0 to your computer and use it in GitHub Desktop.
Save hammadzz/14b04c656109bf3db419f38885afc0e0 to your computer and use it in GitHub Desktop.
Print View Controller Hierarchy
# See http://stackoverflow.com/questions/27966453/how-to-use-printhierarchy-in-lldb-console-with-swift
# Only Obj-C when pressing pause button
po [[[UIWindow keyWindow] rootViewController] _printHierarchy]
# Can use Swift when on breakpoint
po UIApplication.sharedApplication().keyWindow!.rootViewController!._printHierarchy
# Force Obj-C on breakpoint
expr -l objc++ -O -- [[[UIWindow keyWindow] rootViewController] _printHierarchy]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment