For custom views set
isAccessibilityElement = trueEnable Accessible Text Content by adopting
UIAccessibilityReadingContentIn
accessibilityLineNumber(for point: CGPoint) -> Intuse hit testing to identify subviewsIn
accessibilityContent(forLineNumber: Int) -> String?return theaccessibilityLabelfor the subview matching line numberIn
accessibilityFrame(forLineNumber: Int) -> CGRectreturn theaccessibilityFramefor the subview matching line numberIn
accessibilityPageContent() -> String?return the concatenated accessibility labels for all subviews
Enable Automatic Page Turn by
setting
view.accessibilityTraits = UIAccessibilityTraits.causePageTurnon your page viewimplementing
accessibilityScroll(_ direction: UIAccessibilityScrollDirection) -> Bool(lets voice over turn pages)
Customizing Speech by adopting the protocol
UIAccessibilityReadingContentcustomize language by setting
NSAttributedString.Key.accessibilitySpeechLanguagecustomize pitch by setting
NSAttributedString.Key.accessibilitySpeechPitch
Creating an Accessible Reading Experience
The styling and layout of text is a hallmark feature of an outstanding reading experience. Technologies such as CoreText and TextKit give you the tools you need to create a great text layout. Learn how to make an equally great accessible experience for VoiceOver by adopting the accessibility reading content protocol, adding automatic page turning, and customizing speech output.
Missing anything? Corrections? Contributions are welcome!
Written By

Blackjacx