Swift version: 5.1
View debugging lets you visualize exactly how your app is drawing to the screen by exploding your UI into 3D. So, if you're sure you added a button but you just can't see it, view debugging is for you: you can spin your interface around inside Xcode, and you'll probably find your button lurking behind another view because of a bug.
To activate view debugging, first you need to be using iOS 8.0, either on a device or the simulator. Run your app, and browse to the view controller you want to inspect. Now go to Xcode and look just below the main text editor, where the row of debugging buttons live: you want to click the button that has three rectangles in, just to the left of the location arrow.
When you use view debugging your app is paused, so make sure and tell Xcode to continue execution when you're done by pressing Cmd+Ctrl+Y.
SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred by integrating Instabug's SDK in one minute. You will automatically receive device data, network logs, and reproduction steps with every bug and crash report.
Available from iOS 8.0 – see Hacking with Swift tutorial 18
This is part of the Swift Knowledge Base, a free, searchable collection of solutions for common iOS questions.
Link copied to your pasteboard.