Swift version: 5.6
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 AppSweep by Guardsquare helps developers automate the mobile app security testing process with fast, free scans. By using AppSweep’s actionable recommendations, developers can improve the security posture of their apps in accordance with security standards like OWASP.
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.