Hi Team,
I am trying to setup accessibility identifier for backBarButtonItem.
I can not see the identifier in Accessibility Inspector.
Here are my findings:-
What can be the reason for not showing identifier?
I am trying to setup accessibility identifier for backBarButtonItem.
I can not see the identifier in Accessibility Inspector.
Here are my findings:-
UIBarButtonItem is derived from UIBarItem which confirms the protocol UIAccessbilityIdentification.
Setting isAccessibilityElement to true does not work.
Code Block func setUpBarButton() { let backButtonImage = UIImage(named: "icon-backarrow") previousViewController?.navigationController?.navigationBar.backIndicatorImage = backButtonImage previousViewController?.navigationController?.navigationBar.backIndicatorTransitionMaskImage = backButtonImage let backButtonItem = UIBarButtonItem(title: "", style: .plain, target: nil, action: nil) backButtonItem.isAccessibilityElement = true backButtonItem.accessibilityIdentifier = "leftItem" previousViewController?.navigationItem.backBarButtonItem = backButtonItem }
What can be the reason for not showing identifier?