Sunday, October 15, 2023
HomeiOS Developmentios - Why would not my UIViewRepresentable button deal with VoiceOver faucet...

ios – Why would not my UIViewRepresentable button deal with VoiceOver faucet actions?


I’m making an attempt to reuse a customized UIKit management in a SwiftUI display screen, so I’ve wrapped it in a UIViewRepresentable struct. Nevertheless, it doesn’t reply to accessibility faucet gestures (double-tap whereas VoiceOver is enabled).

My code is like

struct SwiftUILargeButton: UIViewRepresentable {
  typealias UIViewType = LargeButton
  func makeUIView(context: Context) -> LargeButton {
    let button = LargeButton()
    ...
    return button
  }
}

struct ConfirmButtonContainer: View {
  var physique: some View {
    SwiftUILargeButton()
  }
}

struct MyScreen: View {
  var physique: some View {
    ZStack {
      ScrollView {
        ...
      }.overlay(
        ConfirmButtonContainer()
        .accessibilityAction {
          // Code to carry out motion
        }
      alignment: backside)
    }
  }
}

It seems to be like VoiceOver selects the ConfirmButtonContainer View, and it reads it as “Verify, button”, however double-tapping the display screen whereas it is chosen solely performs the accessibility motion if there are not any controls scrolled beneath the button within the Stack.

It seems to be like this might not be a UIViewRepresentable situation, however it additionally is perhaps, so I am leaving that within the description.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments