How leptos-null/headerviewer works
Project type and purpose
• HeaderViewer is a native iOS/macOS SwiftUI application.
• Its purpose is to display Objective-C class and protocol headers at runtime by leveraging the ClassDumpRuntime submodule.
File structure
Top-level components:
• .github/workflows – CI/CD release pipeline
• .gitmodules – ClassDumpRuntime submodule declaration
• ClassDumpRuntime – external library for dumping Objective-C runtime types
• HeaderViewer.xcodeproj & workspace – Xcode project and workspace metadata
• HeaderViewer (app target)
– Assets.xcassets (AccentColor, AppIcon)
– Info.plist & entitlements
– SwiftUI view files (ContentView, ListView, RuntimeObjectsView, ImageRuntimeObjectsView, RuntimeObjectDetail, etc.)
– Model types (NamedNode, RuntimeListings, RuntimeObjectType)
• HeaderViewerUITests – UI testing target and screenshot automation
• docs – user-facing screenshots
Key insights from README
• RuntimeBrowser-style UI: list, search, navigation between types
• Ability to load & browse system images on demand
a. UI Layer
• Entry point: HeaderViewerApp.swift → ContentView
• & Navigation views: ListView, RuntimeObjectsView, ImageRuntimeObjectsView
• Detail & syntax highlighting: RuntimeObjectDetail, SemanticStringView
b. Business Logic / Data Layer
• RuntimeListings: orchestrates ClassDumpRuntime calls, caches loaded headers
• NamedNode / RuntimeObjectType: model representation of classes, protocols, images
c. External Dependency
• ClassDumpRuntime submodule: C/Objective-C library that inspects the running process and emits header text
d. System / OS
• iOS/iPadOS runtime providing dynamic library loading and Objective-C runtime
e. Testing
• HeaderViewerUITests: automatic screenshot capture and UI validation
Relationships and data flow
• UI views call into RuntimeListings to fetch node lists or header text
• RuntimeListings invokes ClassDumpRuntime APIs
• ClassDumpRuntime returns raw header strings → passed back to SemanticStringView for syntax coloring
• User interactions (search, image-browser taps) traverse the view hierarchy and trigger new data fetches
• CI pipeline builds the app and publishes releases via .github/workflows/release.yml
Architectural patterns & design principles
• MVVM-style separation: SwiftUI Views observe models exposed by RuntimeListings & NamedNode
• Single source of truth: RuntimeListings holds cache & publishes updates via @Published properties
• Modular external dependency: ClassDumpRuntime isolated as a submodule
• Test automation: UI tests for regression and screenshot documentation