Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jtrivedi/touchinspector
TouchInspector is a drop-in package that helps you visualize and debug touches on iOS and iPadOS.
https://github.com/jtrivedi/touchinspector
debugging devtools ios mobile swift
Last synced: 2 months ago
JSON representation
TouchInspector is a drop-in package that helps you visualize and debug touches on iOS and iPadOS.
- Host: GitHub
- URL: https://github.com/jtrivedi/touchinspector
- Owner: jtrivedi
- License: mit
- Created: 2022-03-27T19:44:04.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-03T20:44:15.000Z (over 2 years ago)
- Last Synced: 2024-10-13T21:11:28.649Z (3 months ago)
- Topics: debugging, devtools, ios, mobile, swift
- Language: Swift
- Homepage:
- Size: 270 KB
- Stars: 138
- Watchers: 6
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![TouchInspector Banner](Banner.png?raw=true "TouchInspector Banner")
# TouchInspector
TouchInspector is a lightweight package that helps you visualize and debug touches on iOS and iPadOS.
Showing touches is super useful when recording and sharing demos from a device or Simulator.
TouchInspector can optionally also show hit-testing information (i.e. which view a touch is hitting). This is great when trying to identify the type of some view, or debug where a touch is actually going.
#### Installation
Add TouchInspector to your app's `Package.swift` file, or selecting `File -> Add Packages` in Xcode:
```swift
.package(url: "https://github.com/jtrivedi/TouchInspector", from: "0.1.0"))
```
#### UsageYou'll need to change the type of your application/scene's `window` to `TouchInspectorWindow`, which you can do conditionally when developing:
```swift
import TouchInspectorfunc scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else {
return
}
let rootViewController = /* Create your root/initial view controller,
either directly or by extracting from a Storyboard */
#if DEBUG
window = TouchInspectorWindow(windowScene: windowScene)
#else
window = UIWindow(windowScene: windowScene)
#endif
window?.rootViewController = rootViewController
window?.makeKeyAndVisible()
}
```Touch **and** hit-testing visualization is enabled by default when creating a `TouchInspectorWindow`. You can change that with the following properties:
```swift
// Show the touch indicator, but not the hit-testing overlay.
window.showTouches = true
window.showHitTesting = false
```