Skip to content

How to tap on system photo picker #help-wanted #1272

Open

Description

@lukaszkn

Any idea how to tap photo or at least cancel button on system photo picker?
I've tried:
[tester tapAccessibilityElement:]
[tester tapScreenAtPoint:]
[tester tapViewWithAccessibilityLabel:@"Cancel"];
[tester dismissPopover]

None of these above do anything.

(lldb) po [UIView printViewHierarchy]
Window level 0.000000 (key window)
...
|	UITransitionView
|	|	UIDimmingView
|	|	UIDropShadowView
|	|	|	_UIRoundedRectShadowView (not highlighted)
|	|	|	UIView
|	|	|	|	UIView
|	|	|	|	|	UILayoutContainerView
|	|	|	|	|	|	UINavigationTransitionView
|	|	|	|	|	|	|	UIViewControllerWrapperView
|	|	|	|	|	|	|	|	_UISizeTrackingView
|	|	|	|	|	|	|	|	|	_UIRemoteView, identifier: RemoteViewBridge
|	|	|	|	|	|	|	|	|	AXRemoteElement, label: (null), traits: none
|	|	|	|	|	|	UIToolbar, label: Toolbar, identifier: Toolbar (invisible)
|	|	|	|	|	|	|	_UIBarBackground
|	|	|	|	|	|	|	|	UIVisualEffectView
|	|	|	|	|	|	|	|	|	_UIVisualEffectBackdropView
|	|	|	|	|	|	|	|	_UIBarBackgroundShadowView
|	|	|	|	|	|	|	|	|	_UIBarBackgroundShadowContentImageView (not highlighted)

Window level 1.000000
UITextEffectsWindow
|	UIInputSetContainerView
|	|	UIInputSetHostView
|	_UITextEffectsRemoteView, identifier: RemoteViewBridge
|	AXRemoteElement, label: (null), traits: none

Simulator Screen Shot - iPhone SE (3rd generation)

Activity

  1. justinseanmartin commented on Dec 15, 2022

    @justinseanmartin
    Contributor

    I believe this is one of the things hosted out of process on modern iOS versions. The best way to workaround it is to swizzle the photo picker APIs and replace the system implementation with something that either presents some alternate UI in process, or automatically calls the expected response APIs without user interaction.

    We have a bunch of tickets (#1156 #1266 #1267) tracking finding a solution to interact with UI elements hosted out of process. Until that is resolved, we're blocked here with the above workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions