{"id":13377624,"url":"https://github.com/indragiek/InAppViewDebugger","last_synced_at":"2025-03-13T03:30:37.175Z","repository":{"id":37549928,"uuid":"178764877","full_name":"indragiek/InAppViewDebugger","owner":"indragiek","description":"A UIView debugger (like Reveal or Xcode) that can be embedded in an app for on-device view debugging","archived":false,"fork":false,"pushed_at":"2024-01-02T00:22:10.000Z","size":16047,"stargazers_count":1879,"open_issues_count":2,"forks_count":109,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-01T09:11:17.860Z","etag":null,"topics":["debugger","debugging","ios","ipad","iphone","swift","ui","uiview","view","visualization"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indragiek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-04-01T01:38:25.000Z","updated_at":"2025-02-26T15:45:31.000Z","dependencies_parsed_at":"2024-01-02T01:42:32.469Z","dependency_job_id":"0f5df88a-6c42-4797-9990-2278bff02862","html_url":"https://github.com/indragiek/InAppViewDebugger","commit_stats":{"total_commits":138,"total_committers":5,"mean_commits":27.6,"dds":"0.050724637681159424","last_synced_commit":"11528fd6e5d97db21ce1472fe3b0846c8c8bc9fa"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indragiek%2FInAppViewDebugger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indragiek%2FInAppViewDebugger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indragiek%2FInAppViewDebugger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indragiek%2FInAppViewDebugger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indragiek","download_url":"https://codeload.github.com/indragiek/InAppViewDebugger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242856053,"owners_count":20196370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugger","debugging","ios","ipad","iphone","swift","ui","uiview","view","visualization"],"created_at":"2024-07-30T06:01:50.807Z","updated_at":"2025-03-13T03:30:37.155Z","avatar_url":"https://github.com/indragiek.png","language":"Swift","readme":"# InAppViewDebugger\n\n[![License](https://img.shields.io/github/license/indragiek/InAppViewDebugger.svg)](LICENSE)\n[![CocoaPods](https://img.shields.io/cocoapods/v/InAppViewDebugger.svg)](https://cocoapods.org/?q=InAppViewDebugger)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"InAppViewDebugger\" src=\"docs/img/main.png\" width=\"700\"\u003e\n\u003c/p\u003e\n\n`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.\n\n## Features\n\n* **3D snapshot view implemented in SceneKit**: Gesture controls for zooming, panning, and rotating.\n* **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\n* **Support for [iPad](docs/img/main.png) and [iPhone](docs/img/iphone1.png)**: Layouts are designed specifically for each form factor.\n* **Extensible:** The base implementation supports `UIView` hierarchies, but this is easily extensible to support any kind of UI framework (e.g. CoreAnimation or SpriteKit)\n\n## Requirements\n\n* iOS 11.0+\n* Xcode 10.1+ (framework built for Swift 4.2)\n\n## Installation\n\n### CocoaPods\n\nAdd the following line to your `Podfile`:\n\n```ruby\npod 'InAppViewDebugger', '~\u003e 1.0.3'\n```\n\n### Carthage\n\nAdd the following line to your `Cartfile`:\n\n```\ngithub \"indragiek/InAppViewDebugger\" \"1.0.3\"\n```\n\n## Usage\n\n### Swift\n\n```swift\nimport InAppViewDebugger\n\n@IBAction func showViewDebugger(sender: AnyObject) {\n  InAppViewDebugger.present()\n}\n```\n\n### Objective-C\n\n```objc\n@import InAppViewDebugger;\n\n// alternative import (they're the same):\n// #import \u003cInAppViewDebugger/InAppViewDebugger-Swift.h\u003e\n\n- (IBAction)showViewDebugger:(id)sender {\n  [InAppViewDebugger present];\n}\n```\n\n### `lldb`\n\n```\n(lldb) expr -lswift -- import InAppViewDebugger\n(lldb) expr -lswift -- InAppViewDebugger.present()\n```\n\nThe `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.\n\n## Controls\n\n### Focusing on an Element\n\nTo focus on the subhierarchy of a particular element, **long press on the element** to bring up the action menu and tap \"Focus\". The long press can be used both in the hierarchy view and the 3D snapshot view. The \"Log Description\" action will log the description of the element to the console, so that if you're attached to Xcode you can copy the address of the object for further debugging.\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Focusing on an Element\" src=\"docs/img/focus.gif\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### Adjusting Distance Between Levels\n\nThe slider on the bottom left of the snapshot view can be used to adjust the spacing between levels of the hierarchy:\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Adjusting Distance Between Levels\" src=\"docs/img/distance.gif\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### Adjusting Visible Levels\n\nThe range slider on the bottom right of the snapshot view can be used to adjust the range of levels in the hierarchy that are visible:\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Adjusting Visible Levels\" src=\"docs/img/slicing.gif\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### Showing/Hiding Headers\n\nEach UI element has a header above it that shows its class name. These headers can be hidden or shown by **long pressing on an empty area of the snapshot view** to bring up the action menu:\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Showing/Hiding Headers\" src=\"docs/img/headers.gif\" width=\"700\"\u003e\n\u003c/p\u003e\n\n### Showing/Hiding Borders\n\nSimilarly to the headers, the borders drawn around each element can also be shown or hidden:\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"Showing/Hiding Borders\" src=\"docs/img/borders.gif\" width=\"700\"\u003e\n\u003c/p\u003e\n\n## Customization\n\nColors, fonts, and other attributes for both the snapshot view and the hierarchy view can be changed by creating a custom [`Configuration`](InAppViewDebugger/Configuration.swift). The configuration is then passed to a function like `InAppViewDebugger.presentForWindow(:configuration:completion:)`.\n\n## Extending for Other UI Frameworks\n\nThe current implementation only supports `UIView` hierarchies, but this can easily be extended to support other UI frameworks by conforming to the [`Element`](InAppViewDebugger/Element.swift) protocol. See [`ViewElement`](InAppViewDebugger/ViewElement.swift) to see what an example implementation looks like — by providing a the frame, a snapshot image, and a few other pieces of information, all of the features described above will work for your own framework.\n\nA [`Snapshot`](InAppViewDebugger/Snapshot.swift) instance represents a recursive snapshot of the *current state* of a UI element hierarchy, and is constructed using an `Element`. The snapshot can then be passed to\n```swift\nInAppViewDebugger.presentWithSnapshot(:rootViewController:configuration:completion:)\n```\nto show the view debugger.\n\n## Credits\n\n* [Kyle Van Essen](https://twitter.com/kyleve) for [this tweet](https://twitter.com/kyleve/status/1111689823759171585) picturing Square's implementation that inspired me to build this\n* [AudioKit SynthOne](https://github.com/AudioKit/AudioKitSynthOne), an amazing open-source audio synthesizer app for the iPad that made for a great demo as pictured above\n\n## Contact\n\n* Indragie Karunaratne\n* [@indragie](http://twitter.com/indragie)\n* [http://indragie.com](http://indragie.com)\n\n## License\n\n`InAppViewDebugger` is licensed under the MIT License. See `LICENSE` for more information.\n","funding_links":[],"categories":["Swift","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findragiek%2FInAppViewDebugger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findragiek%2FInAppViewDebugger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findragiek%2FInAppViewDebugger/lists"}