Skip to content

Commit 4c77a6f

Browse files
committed
README updates
1 parent 45694b6 commit 4c77a6f

File tree

1 file changed

+76
-1
lines changed

1 file changed

+76
-1
lines changed

README.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,80 @@
44
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
55

66
<p align="center">
7-
<img alt="InAppViewDebugger" src="images/main.png" width="100%" max-width="800">
7+
<img alt="InAppViewDebugger" src="images/main.png" width="700">
8+
</p>
9+
10+
`InAppViewDebugger` is a library that implements a view debugger with a 3D snapshot view and a hierarchy view, similar to [Reveal](https://revealapp.com) and [Xcode's own view debugger](https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/ExaminingtheViewHierarchy.html). The key distinction is, as the project title suggests, that this can be embedded inside the app and used on-device to debug UI issues without needing to be tethered to a computer.
11+
12+
### Features
13+
14+
* **3D snapshot view implemented in SceneKit**: Gesture controls zooming, panning, and rotating
15+
* **Hierarchy (tree) view that synchronizes its selection with the 3D view**: This is a feature I really wanted in Xcode, to be able to visually find a view and see where it is in the hierarchy view
16+
* **Support for iPad and iPhone**: Layouts are designed specifically for each form factor.
17+
* **Extensible:** The base implementation supports `UIView` hierarchies, but this is easily extensible to support any kind of UI framework (e.g. CoreAnimation or SpriteKit)
18+
19+
### Requirements
20+
21+
* iOS 11.0+
22+
* Xcode 10.1+ (framework built for Swift 4.2)
23+
24+
### Installation
25+
26+
#### CocoaPods
27+
28+
Add the following line to your `Podfile`:
29+
30+
```
31+
pod 'InAppViewDebugger', '~> 1.0.0'
32+
```
33+
34+
#### Carthage
35+
36+
Add the following line to your `Cartfile`:
37+
38+
```
39+
github "indragiek/InAppViewDebugger" "1.0.0"
40+
```
41+
42+
### Usage
43+
44+
#### Swift
45+
46+
From code:
47+
48+
```swift
49+
import InAppViewDebugger
50+
51+
@IBAction func showViewDebugger(sender: AnyObject) {
52+
InAppViewDebugger.present()
53+
}
54+
```
55+
56+
From `lldb`:
57+
58+
```
59+
(lldb) e -lswift -- import InAppViewDebugger
60+
(lldb) e -lswift -- InAppViewDebugger.present()
61+
```
62+
63+
#### Objective-C
64+
65+
```objc
66+
#import <InAppViewDebugger/InAppViewDebugger-Swift.h>
67+
68+
- (IBAction)showViewDebugger:(id)sender {
69+
[InAppViewDebugger present];
70+
}
71+
```
72+
73+
The `present` function shows the UI hierarchy for your application's key window, presented over the top view controller of the window's root view controller. There are several other methods available on `InAppViewDebugger` for presenting a view debugger for a given window, view, or view controller.
74+
75+
### Controls
76+
77+
#### Adjusting Distance Between Levels
78+
79+
The slider on the bottom left of the snapshot view can be used to adjust the spacing between levels of the hierarchy:
80+
81+
<p align="center">
82+
<img alt="InAppViewDebugger" src="images/distance.gif" width="700">
883
</p>

0 commit comments

Comments
 (0)