# siteline/swiftui-introspect

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/siteline-swiftui-introspect).**

6,510 stars · 416 forks · Swift · MIT

## Links

- GitHub: https://github.com/siteline/swiftui-introspect
- Homepage: https://swiftpackageindex.com/siteline/swiftui-introspect/main/documentation/swiftuiintrospect
- awesome-repositories: https://awesome-repositories.com/repository/siteline-swiftui-introspect.md

## Topics

`appkit` `inspect` `inspection` `introspection` `nsview` `nsviewcontroller` `swiftui` `uikit` `uiview` `uiviewcontroller`

## Description

swiftui-introspect is a native view introspection library that provides a bridge between declarative interfaces and their underlying platform components. It functions as a reference manager and component wrapper, allowing for the retrieval and manipulation of the native platform views that power a user interface.

The project enables the access of underlying UIKit and AppKit view instances to apply customizations and styling not available through standard APIs. It allows for the definition of custom types to gain access to native platform views that are not supported by default, effectively extending the framework to include native views not yet officially wrapped.

The library incorporates a system for storing weak references to native platform views to prevent memory leaks and retain cycles. This is supported by a suite of utilities for platform integration and native view memory management.

## Tags

### Mobile Development

- [Native Platform Access](https://awesome-repositories.com/f/mobile-development/android-ecosystem/android-platform-integrations/native-platform-access.md) — Connects SwiftUI layouts with native platform views to enable the use of advanced Apple framework features.
- [Native API Customizations](https://awesome-repositories.com/f/mobile-development/ios-apple-ecosystem/swiftui/native-api-customizations.md) — Accesses underlying UIKit or AppKit components to apply styling and behavior not available in the standard SwiftUI API.
- [Native View Accessors](https://awesome-repositories.com/f/mobile-development/ios-apple-ecosystem/swiftui/native-view-accessors.md) — Provides a utility for extending SwiftUI views with direct access to underlying UIKit or AppKit view instances.
- [Native View Wrappers](https://awesome-repositories.com/f/mobile-development/ios-apple-ecosystem/swiftui/native-view-wrappers.md) — Creates custom support for native views that are not yet officially wrapped by the SwiftUI framework.
- [UIKit Interoperability](https://awesome-repositories.com/f/mobile-development/ios-apple-ecosystem/swiftui/uikit-interoperability.md) — Bridges SwiftUI with UIKit and AppKit to apply customizations via native platform APIs.

### Data & Databases

- [Declarative-to-Native View Mappings](https://awesome-repositories.com/f/data-databases/data-type-definitions/abstract-type-systems/platform-specific-type-mappings/declarative-to-native-view-mappings.md) — Links high-level declarative view types to their corresponding concrete UIKit or AppKit implementation classes.

### Education & Learning Resources

- [UI Component Weak References](https://awesome-repositories.com/f/education-learning-resources/language-reference-guides/reference-safety/weak-reference-wrappers/ui-component-weak-references.md) — Prevents memory leaks by storing native view pointers in non-retaining wrappers until the view is detached.

### User Interface & Experience

- [Native UI Tree Traversers](https://awesome-repositories.com/f/user-interface-experience/component-hierarchies/hierarchy-traversers/native-ui-tree-traversers.md) — Recursively searches the native view tree to find specific component types based on class identity.
- [Native View Introspection](https://awesome-repositories.com/f/user-interface-experience/native-view-introspection.md) — Provides a mechanism to retrieve and manipulate the underlying platform components that power a SwiftUI user interface.
- [Native View Reference Tracking](https://awesome-repositories.com/f/user-interface-experience/native-view-mappers/native-view-reference-tracking.md) — Provides a system for storing weak references to native platform views without creating memory leaks or retain cycles.
- [Custom Introspection Types](https://awesome-repositories.com/f/user-interface-experience/view-customizations/custom-introspection-types.md) — Enables the definition of custom types to gain access to native platform views that are not supported by default. ([source](https://cdn.jsdelivr.net/gh/siteline/swiftui-introspect@main/README.md))
- [View Lifecycle Hooks](https://awesome-repositories.com/f/user-interface-experience/view-lifecycle-hooks.md) — Implements custom closure logic that hooks into the SwiftUI view lifecycle after native initialization.

### Programming Languages & Runtimes

- [UI Rendering Pipeline Injection](https://awesome-repositories.com/f/programming-languages-runtimes/erasure-based-type-systems/ui-rendering-pipeline-injection.md) — Injects custom logic into the view rendering pipeline by wrapping native components in generic containers.
- [UI View Subclass Casting](https://awesome-repositories.com/f/programming-languages-runtimes/type-safe-view-casting/ui-view-subclass-casting.md) — Provides a mechanism to cast generic native view references into specific platform types to unlock restricted API methods.

### Software Engineering & Architecture

- [Memory Leak Prevention](https://awesome-repositories.com/f/software-engineering-architecture/memory-usage-analysis/memory-leak-prevention.md) — Handles weak references to native views within SwiftUI to prevent memory leaks and retain cycles.
- [Native Bridge Memory Management](https://awesome-repositories.com/f/software-engineering-architecture/native-bridges/native-bridge-memory-management.md) — Provides a specialized property wrapper to store references to native views without creating memory leaks. ([source](https://cdn.jsdelivr.net/gh/siteline/swiftui-introspect@main/README.md))

### Part of an Awesome List

- [Developer Tools](https://awesome-repositories.com/f/awesome-lists/devtools/developer-tools.md) — Access underlying UIKit components from within the framework.
