Revert (REVEal Rendering Test) is an iOS project we’ve built to help test the performance and accuracy of Reveal, our runtime view hierarchy inspection tool. It contains a number of examples which highlight both common and edge case scenarios, and helps us to ensure that we don’t regress or introduce rendering and serialization bugs when updating Reveal.
We’re releasing Revert so that:
- The community can compare the features and accuracy of the various view debuggers on the market using a simple, attractive example.
- The developers of other view debuggers on the market have access to a standard reference suite of tests to check the accuracy of their own products.
Accuracy as a goal
Reveal communicates with a small HTTP server embedded in your iOS application to retrieve information about the view hierarchy at runtime. This information includes the structure of the view hierarchy, bitmaps that represent those views and all properties of the views. Once retrieved, Reveal presents the information hierarchically in an outline view, as well as graphically on a central canvas.
The way in which Reveal interprets this information visually is critically important for users who rely on our app to present an accurate reflection of their application’s state. We go to great lengths to ensure that Reveal renders as accurately as possible, and this focus on accuracy has influenced our approach in a number of areas.
The canvas in Reveal takes one of two divergent rendering paths to ensure that what you see in Reveal reflects what you see in your app:
- The 3D canvas mode approximates how the iOS runtime lays out views.
- The 2D canvas mode grabs a composited screenshot of the inspected component directly from the iOS runtime, rather than approximating how things might be laid out.
The end result is that what you see on screen in Reveal is much more accurate to what’s actually visible on your device or simulator.
Using Revert’s test suite as an example, it’s pretty easy to see how much more accurate Reveal is than the Xcode view debugger:
MKMapView displays the origin of Itty Bitty Apps employees. All the annotations are linked together by an
A selection of transformed views with embedded subviews showing both the transformed and identity (non-transformed) positions:
- Translate: A view that has been translated (-20, 20).
- Rotate: A view that has been rotated 15°.
- Scale: A view that has been scaled by 50%.
The behaviour when mixing constraints and transforms changed between iOS 7 and 8. We published a breakdown of these changes in a previous blog post.
Bounds and Anchor Point Changes
Shows the effects of bounds and anchor point changes.
Reveal’s accuracy is the result of a huge amount of development work. The examples above present a few specific scenarios that highlight the care we take, and the level of detail we pursue when developing Reveal.
We’ve tried to include as many scenarios as possible, but if you’d like to add your own or suggest one that should be supported, please feel free to create a pull request or contact us directly via our online support.