2

I've got a UIButton in my IOS app that I'm trying to remove when users have Voiceover enabled. I'm able to hide it, but it still appears in the Voiceover swipe list AND is still selectable, if I happen to click in that area of the screen. I've tried:

self.chevronButton.isHidden = true
self.chevronButton.isEnabled = false
self.chevronButton.isAccessibilityElement = false
self.chevronButton.alpha = 0
self.chevronButton.accessibilityElementsHidden = true
UIAccessibility.post(notification: UIAccessibility.Notification.layoutChanged, argument: nil)

This only seems to make the button invisible. How can I remove it from the Voiceover swipe list and make it so that is cannot be selected by touch?

szaske
  • 1,887
  • 22
  • 32
  • try chevronButton.removeFromSuperview() – Tad Oct 22 '20 at 06:29
  • Please post some screen shots of the view & where is your voiceover list is implemented. – Suhail Oct 22 '20 at 09:06
  • More context information is needed to provide the appropriate answer. Create a simple project with 2 buttons, untick 'Accessibility-Enabled' for one of them and you'll notice that this button will be hidden to VoiceOver. – XLE_22 Oct 26 '20 at 15:58

0 Answers0