I have same issue, when on screen presenting
UIPickerView in custom
UIView in property
inputView from
UITextFieldCode Block swift| let datePicker = DatePicker() |
| ... |
| textField.inputView = datePicker |
where
DatePicker:
Code Block swift| final class DatePicker: UIControl { |
| private let pickerView = UIPickerView() |
|
| override init(frame: CGRect = .zero) { |
| super.init(frame: frame) |
|
| setupPickerView() |
| ... |
| } |
|
| private func setupPickerView() { |
| addSubview(pickerView) |
|
| pickerView.dataSource = self |
| pickerView.delegate = self |
|
| ... |
| } |
| } |
And in UI Test:
Code Block swift| func testExample() throws { |
| let app = XCUIApplication() |
| app.launch() |
|
| app.textFields["TheTextField"].tap() |
|
| /* After DatePicker is displayed on screen |
| XCUIApplication stops working at all |
| Can't find the window |
| It falls on timeout and can not collect the view hierarchy */ |
| app.windows.element(boundBy: 0) |
| } |
Xcode 12.2