How siteline/swiftui-introspect works
SwiftUI Introspect is a Swift package that lets application code customize the native UIKit/AppKit view or controller backing a SwiftUI view. The workflow is: a consumer applies .introspect with a view type and supported OS versions; the modifier installs invisible boundary/inspection views; a selector searches the relevant native hierarchy; and the customization closure receives a matching platform entity. The tree and README document a broad set of controls, containers, navigation, and presentation adapters. Some adapter implementations were not sampled, so their internal search details are not expanded here.
Main entry points: IntrospectableViewType.swift Introspectable type · Introspect.swift Introspect modifier · IntrospectionSelector.swift Target selector · IntrospectionView.swift Inspection view
Components 17
Public API
- Introspect modifier
Sources/Introspect.swift - Introspectable type
Sources/IntrospectableViewType.swift
Introspection runtime
- Target selector
Sources/IntrospectionSelector.swift - Inspection view
Sources/IntrospectionView.swift - Platform abstractions
Sources/PlatformView.swift - View markers
Sources/Introspect.swift
Platform selection
- Version predicates
Sources/PlatformViewVersion.swift - OS version checks
Sources/PlatformVersion.swift
View adapters
- Control adapters
Sources/ViewTypes - Collection adapters
Sources/ViewTypes - Navigation adapters
Sources/ViewTypes - Presentation adapters
Sources/ViewTypes - Other view adapters
Sources/ViewTypes
Other components
- SwiftUI app code
- SwiftUI hierarchy
- UIKit / AppKit
- Customization closure
Connections 18
- SwiftUI app code → Introspect modifier: applies modifier
- SwiftUI app code → Customization closure: provides closure
- Introspect modifier → Introspectable type: accepts type
- Introspect modifier → Version predicates: selects supported OS
- Version predicates → OS version checks: checks availability
- Introspect modifier → View markers: installs markers
- View markers → SwiftUI hierarchy: bracket view
- Introspect modifier → Inspection view: embeds inspector
- Inspection view → Target selector: invokes selector
- Target selector → UIKit / AppKit: searches hierarchy
- Inspection view → Customization closure: passes matched target
- Target selector → Platform abstractions: uses platform entities
- Control adapters → Introspectable type: defines supported types
- Collection adapters → Introspectable type: defines supported types
- Navigation adapters → Introspectable type: defines supported types
- Presentation adapters → Introspectable type: defines supported types
- Other view adapters → Introspectable type: defines supported types
- Version predicates → Target selector: provides selected selector