I have problem with UISearchController. It is adding one extra View as direct child of its View. It has isAccessibilityElement = true and description "Double-tap to dismiss", this blocks all Appium automatic testing. I can't figure out why, where and how it is added.
Someone know when and why this view is added and how to remove it? I have tried to set its isAccessibilityElement = false form code but somehow it is set back to true in some cases.
For anyone else who has this issue. It's caused by the default behaviour Apple have given the
UISearchControllerwhere thesearchResultsControlleris initially hidden until theUISearchBarhas text.We had old code in the searchResultsController to unhide itself
view.isHidden = falsewhich fought this default logic.The fix was to remove this and instead set
searchController.showsSearchResultsController = truewhich shows the results always and doesn't add the double tap to dismiss view.