iosswiftaccessibilityvoiceover

Voice over speak tab bar below popup


I have a modal(popup) in that when voice over reads the last element after that it start speaking tab bar elements.

I have used some property like:

view.accessibilityViewIsModal = true
UIAccessibility.post(notification: .layoutChanged, argument: self)
UIAccessibility.post(notification: .screenChanged, argument: self)
self.isAccessibilityElement = true
view.isAccessibilityElement = true

Expected : it should not read tab bar below popup


Solution

  • You can assign higher window to your view with some delay.

    perform(#selector(self.assignWindowLevel), with: nil, afterDelay: 0.2)
    
     @objc func assignWindowLevel() {
        self.window?.windowLevel = UIWindow.Level.alert + 1.2
    }