nalexn/ViewInspector
Runtime introspection and unit testing of SwiftUI views observed · 2026-08-28
Health v2 · maintenance only
73/100
- Activity 99
- Release rhythm 24
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 111
- age_days: 2482
- days_rel: 346
- days_push: 11
- n_releases_24m: 4
Adoption not part of the score
2629 stars · 193 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Swift library for unit testing SwiftUI views by traversing the view hierarchy at runtime and exposing the underlying view structs. It uses official Swift reflection APIs to inspect standard and custom views, read their state, and simulate user interactions.
Use cases
- unit test SwiftUI views
- find views of a specific type in a SwiftUI hierarchy
- read the internal state of standard SwiftUI views like Text
- verify custom view state such as @State and @ObservedObject
- simulate button taps and trigger callbacks in tests
- write asynchronous tests for views with onAppear callbacks
When to choose
- you want to unit test SwiftUI view logic and hierarchy without snapshot testing
- you need to assert on view attributes, state, or bindings in XCTest
- you want to simulate user interactions like taps in SwiftUI tests
When to avoid
- you need UI rendering or pixel-level snapshot tests rather than structural inspection
- your project does not use SwiftUI
- you need to add it to the production target - it is test-target only
Facets
library · maturity active
testing developer-tools testing frontend developer-tools swiftui unit-testing runtime-introspection view-hierarchy xctest ios macos swift
1 source
- readme: https://github.com/nalexn/ViewInspector · fetched 2026-08-28 · ba33c6bf1bc0
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| nalexn/ViewInspector | main | 73 |
For agents
markdown · JSON · MCP: product_card(name="nalexn/ViewInspector")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem