Company
Date Published
Author
Instabug Team
Word count
659
Language
English
Hacker News points
None

Summary

The developers at Instabug implemented the View Hierarchy feature to provide users with more detailed information about their UI, including where defects exist and how to fix them. The feature uses 3D layers to visualize the app views and inspect each layer's properties. However, calculating the visible frame of a UIView proved to be challenging due to clipsToBounds and UIScrollView issues. To overcome this, they developed an algorithm that recursively captures intersections between superview and subview frames, taking into account clipsToBounds and scroll view cases. Additionally, they leveraged data structures like linked lists to capture screenshots in the main thread while avoiding UI freezing, allowing for efficient and asynchronous execution of each node's task. The View Hierarchy feature was released in February 2017 as part of the Instabug SDK.