Debug Layout Issues in Swift April 2, 2016

Sometimes I come across a situation where I expect a View to layout on the screen in a particular way, but for some reason it doesn't appear where I expect it to appear, or it doesn't appear at all. In those cases, this console command (when the App is paused) comes in handy. It prints to the logs each of the Views and its frame. You can look look through these logs and find, "oh, that view doens't have a height" and then go find the constraint that needs to be added/changed to fix the issue.

            
        po [[UIWindow keyWindow] recursiveDescription]
            
          

That's it! Have fun and #CompileSwift.