installAutographNativeTapCapture
Starts reporting taps on native UIKit content as eventName, resolved by resolveNativeTapTargetByHitTest — one resolver, which reads no accessibility state at any point.
Opt-in, exactly as Compose autocapture is: observing every tap is a different privacy posture than instrumenting individual elements, so nothing happens until an app calls this.
UIKit is covered, in a cold process and a warm one alike. SwiftUI is not covered at all (#189, #191). A UIControl, or a view carrying an enabled single-tap recognizer, resolves through UIView.hitTest — the path UIKit actually delivers the touch along — provided it carries an accessibilityIdentifier, which is the only thing ever reported as a target. An untagged control resolves to nothing. SwiftUI has no per-element backing view for hitTest to find (measured: a whole SwiftUI screen is a handful of UIViews, and .accessibilityIdentifier appears on none of them), and no public API offers another route, so taps on a SwiftUI surface must be instrumented explicitly with a track() call. Compose content has its own pipeline and is unaffected by any of this.
Why SwiftUI is not captured warm either, though it once was. UIKit and SwiftUI build the accessibility element tree only once an accessibility client has run in the process — VoiceOver, Voice Control, the Accessibility Inspector, an XCUITest runner. A resolver that walked that tree named SwiftUI elements only there, so what it captured was conditioned on the user's assistive technology and on test automation, and its silence elsewhere read as nobody having tapped. That is biased data, worse to ship than none, so #191 removed it (#135; design notes).
A tap that resolves to nothing is at least not silently lost: the first time it happens, an NSLog line explains why — see warnOnceIfANativeTapResolvedToNothing — so a developer running the app during integration has something in the console instead of nothing.
Pass the same scopeStack the app gives AutographProvider if it also renders Compose. Sharing one stack is what lets a native tap carry the screen and scope a Compose screen pushed, and vice versa; two stacks leave both sides attributing against half-empty context.
Taps on Compose content are not reported here. autograph-compose registers its host views and this pipeline drops any tap whose hit path crosses one, so a hybrid app reports each tap exactly once, from the pipeline that owns the content. See AutographComposeHosts.
A native tap's screen comes from the shared scopeStack or not at all. Nothing falls back to ScreenHistory, on either pipeline: history records what has been seen, not what is on display. For UIKit screens to reach native taps, also call installAutographNativeScreenCapture, which pushes a screen frame onto the same stack for each view controller that names one.
Threading. Main thread only, to install and to uninstall — it touches UIKit throughout.
Keep the returned handle: it is the only way to AutographNativeTapCapture.uninstall, and the capture holds tracker and scopeStack strongly until then.