• Original link: Shock! IOS system has its own suspension window debugging tool — Jinkey original
  • Author: Jinkey

1 background

English text: ryanipete.com/blog/ios/sw…

What I wrote is not a translation but a restatement of this function with my own understanding, which is different from the original content. If you have the ability, you can check the English original.

We often use a variety of debugging tools, or open source libraries to support the suspension debugging information window, but apple’s private methods provide a UIDebuggingInformationOverlay.

2 How to Use it

The AppDelegate didFinishLaunchingWithOptions method to add two lines of code.

let overlayClass = NSClassFromString("UIDebuggingInformationOverlay") as? UIWindow.Type _ = overlayClass? .perform(NSSelectorFromString("prepareDebuggingOverlay"))Copy the code

After running the program, two fingers click on the status bar to bring up the debug suspension layer.

What does 3 do

3.1 Viewing the EntirewindowViewNested relations

View Hierarchy

This feature allows you to view the page-level structure tree by clicking an exclamation mark to go to the detail page (clicking cell is unresponsiveness), which shows the view’s frame, bounds, and other instance variables.

3.2 Viewing current InformationViewControllerThe properties of the

VC Hierarchy

View the active ViewController’s childrenViewCotroller structure tree and related properties:

3.3 check theUIApplicationMember properties of

Ivar Explorer

3.4 Measuring component size

Measure

At first, I didn’t know how to use it. Later, I realized that you can just drag your finger directly on the outside of the suspension window. If your component is blocked by the suspension window, there seems to be no way to use it. Select Vertical and drag to display the height of a component. Select Horizontal, drag your finger on the screen to display the width of a component;

3.5 Effect Comparison

Spec Compare

From reading a picture album (you must be in the info. The plist configuration first album access NSPhotoLibraryUsageDescription) and compare the current interface.

Click Add -> select a screenshot from the album -> click the newly added screenshot -> slide your finger up and down the screen (floating window part) -> Dynamically change the transparency of the screenshot to compare the difference between the screenshot and the current interface -> double click to exit.

My wechat public account Jinkey-love welcomes communication