Swiftpack.co - LeoNatan/LNViewHierarchyDumper as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by LeoNatan.
LeoNatan/LNViewHierarchyDumper 1.3.1
Dump your view hierarchies programmatically to Xcode 12 and above compatible view hierarchy file archives.
⭐️ 19
🕓 7 weeks ago
iOS macOS watchOS tvOS macCatalyst
.package(url: "https://github.com/LeoNatan/LNViewHierarchyDumper.git", from: "1.3.1")

LNViewHierarchyDumper

A framework for programmatically dumping the view hierarchy of your app into an Xcode 12 and above compatible view hierarchy file archive.

GitHub release GitHub stars GitHub license PayPal Donation Button

GitHub issues GitHub contributors

The framework supports dumping the view hierarchy of apps running on iOS, tvOS and watchOS simulators, hardware devices with developer image mounted, and macOS and Catalyst with Xcode installed. Under unsupported targets or environments, the frameworks fails silently and returns an error.

This framework uses Xcode's internal DebugHierarchyFoundation framework, and is not AppStore safe, thus you should use with care, only linking against it in development/testing scenarios/builds. Since the framework requires developer tooling (developer image mounted on iOS hardware; Xcode on macOS), there would be little benefit from having this framework in production anyway.

Deploying the framework conditionally is a complex topic, beyond the scope of this README. One strategy can be to link the dynamic library with UI testing project, and launch your app with the DYLD_INSERT_LIBRARIES environment variable, pointing to the LNViewHierarchyDumper framework.

Using the framework is very easy:

import LNViewHierarchyDumper

//...

let url = //URL to a directory
try LNViewHierarchyDumper.shared.dumpViewHierarchy(to: url)

GitHub

link
Stars: 19
Last commit: 4 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v1.3.1
7 weeks ago
  • Fixes to the Xcode project of the framework (if used outside of Swift Package Manager)
  • Fixed a few warnings

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics