{"repo":"siteline/swiftui-introspect","free":true,"listed":false,"github":"https://github.com/siteline/swiftui-introspect","clone":"git clone https://github.com/siteline/swiftui-introspect.git","description":"Introspect underlying UIKit/AppKit components from SwiftUI","language":"Swift","stars":6541,"topics":["appkit","inspect","inspection","introspection","nsview","nsviewcontroller","swiftui","uikit","uiview","uiviewcontroller"],"license":"MIT","category":"mobile-apps","readme_excerpt":"SwiftUI Introspect ================= SwiftUI Introspect lets you access the underlying UIKit or AppKit view for a SwiftUI view. - How it works - Install - View Types - Examples - General Guidelines - Advanced usage - Implement your own introspectable type - Introspect on future platform versions - Keep instances outside the customize closure - Note for library authors - Community projects How it works ------------ SwiftUI Introspect adds an invisible IntrospectionView above the selected view and an invisible anchor below it, then searches the UIKit/AppKit view hierarchy between them to find the relevant view. For instance, when introspecting a ScrollView ... ... it will: 1. Add marker views before and after ScrollView . 2. Traverse through all subviews between both marker views until a UIScrollView instance (if any) is found. [!IMPORTANT] Although this method is solid and unlikely to break on its own, future OS releases require explicit opt in for introspection ( .iOS(.vXYZ) ) because underlying UIKit/AppKit types can change between major versions. By default, .introspect acts on its receiver. Calling .introspect from inside the view you want to introspect has no effect. If you need to introspect an ancestor instead, set scope: .ancestor : Usage in production SwiftUI Introspect is suitable for production. It does not use private APIs. It inspects the view hierarchy using public methods and takes a defensive approach: it makes no hard layout assumptions, performs no forced cas","default_branch":null,"files":null,"tree":[],"storefront":"/r/siteline","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/siteline/swiftui-introspect/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}