Post

Replies

Boosts

Views

Activity

Reply to How to to expose elements for automation but not for accessibility in swift UIKit?
This is a working solution dataDisclosureView.accessibilityElements = [dataDisclosureView as Any, titleLabel as Any, descriptionLabel as Any, requestButton as Any, hintLabel as Any] if #available(iOS 17.0, *) { dataDisclosureView.automationElements = [titleLabel as Any, descriptionLabel as Any, requestButton as Any, hintLabel as Any] } else { // Fallback on earlier versions } but I am not satisfied with that because in one of Apple WWDC video it was mentioned that if we want exempt item from voice over accessibility don't add it in accessibilityItems and if we want in automation elements just add it. They haven't provided deeper details . Reference is https://www.youtube.com/watch?v=IAqzXI3kFCk also adding screenshot about what I am saying According to this it should be dataDisclosureView.accessibilityElements = [dataDisclosureView as Any, titleLabel as Any, descriptionLabel as Any, requestButton as Any] if #available(iOS 17.0, *) { dataDisclosureView.automationElements = [titleLabel as Any, descriptionLabel as Any, requestButton as Any, hintLabel as Any] } else { // Fallback on earlier versions }
Oct ’24