You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to set accessibility for a SwiftUI view that is presented within a hosting view controller that SwiftMessages presents. I attempted conforming to AccessibleMessage and setting the UIHostingController to the accessibleElement property. This did not seem to work as the Appium inspector that we're using still does not see the buttons within the SwiftUI View. Any tips on getting accessibillity to work with SwiftUI?
SwiftUI container UIView
class PopUpContainerView<T: View>: UIView, AccessibleMessage {
// Accessibility for E2E testing
var accessibilityMessage: String?
var accessibilityElement: NSObject?
var additonalAccessibilityElements: [NSObject]?
let uiContainerView: UIHostingController<T>
init(content: T, cornerRadius: CGFloat = 15, padding: CGFloat = 24) {
uiContainerView = UIHostingController(rootView: content)
super.init(frame: .zero)
addSubview(uiContainerView.view)
uiContainerView.view.layer.cornerRadius = cornerRadius
uiContainerView.view.pinSuperview(horizontalPadding: padding)
accessibilityElement = uiContainerView
}
@available(*, unavailable)
required init(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
I'm attempting to set accessibility for a SwiftUI view that is presented within a hosting view controller that SwiftMessages presents. I attempted conforming to
AccessibleMessage
and setting the UIHostingController to theaccessibleElement
property. This did not seem to work as the Appium inspector that we're using still does not see the buttons within the SwiftUI View. Any tips on getting accessibillity to work with SwiftUI?SwiftUI container UIView
which is presented like this:
The text was updated successfully, but these errors were encountered: