adjustments

This commit is contained in:
Kevin G Christiano 2020-12-23 12:40:21 -05:00
parent 1e4963f58e
commit 5b42466c7c
2 changed files with 6 additions and 10 deletions

View File

@ -15,21 +15,17 @@ extension UIView {
guard let window = UIApplication.shared.keyWindow else { return nil }
func findByID(view: UIView, _ id: String) -> UIView? {
func find(view: UIView, by id: String) -> UIView? {
if view.accessibilityIdentifier == id {
return view
}
if view.accessibilityIdentifier == id { return view }
for v in view.subviews {
if let a = findByID(view: v, id) {
return a
}
if let aView = find(view: v, by: id) { return aView }
}
return nil
}
return findByID(view: window, identifier)
return find(view: window, by: identifier)
}
}

View File

@ -453,8 +453,8 @@ import UIKit
entryFieldModel.isValid = true
entryFieldModel.text = ""
if let view = UIView.findByAccessibility(identifier: fieldKey), let moleculeView = view as? MoleculeViewProtocol {
DispatchQueue.main.async { [self] in
DispatchQueue.main.async { [self] in
if let view = UIView.findByAccessibility(identifier: fieldKey), let moleculeView = view as? MoleculeViewProtocol {
moleculeView.set(with: entryFieldModel, delegateObjectIVar, nil)
}
}