-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Multiple UI elements in Telegram for iOS are not exposed correctly to VoiceOver, making the app partially or fully unusable for blind users. The issue is caused by missing or incorrect accessibility properties in custom UI components, custom gesture handlers, and dynamic screens.
-
Missing accessibilityLabel and accessibilityTraits on Interactive UI Elements
Many tappable elements (buttons, message actions, tabs, icons) are announced by VoiceOver as “button” or “unlabeled button” with no descriptive label.
Technical Cause
Custom views appear to be created without implementing basic accessibility properties:
swift
Copy
button.isAccessibilityElement = true
button.accessibilityLabel = "Reply"
button.accessibilityTraits = .button
If Telegram uses custom drawing layers (e.g., CALayer, UIView subclasses), they must explicitly declare accessibility elements:
swift
Copy
override var isAccessibilityElement: Bool {
get { return true }
set {}
} -
Message Cells Are Not Exposed as Valid Accessibility Containers
VoiceOver cannot consistently navigate messages in a chat. Focus jumps unpredictably, and some messages are skipped entirely.
Technical Cause
UITableViewCell or custom chat cells do not expose sub-elements to the accessibility tree using UIAccessibilityContainer.
Correct structure:
swift
Copy
override func accessibilityElementCount() -> Int {
return accessibilityItems.count
}
override func accessibilityElement(at index: Int) -> Any? {
return accessibilityItems[index]
}
override func index(ofAccessibilityElement element: Any) -> Int {
return accessibilityItems.firstIndex(where: { $0 === element }) ?? 0
}
When this container interface is missing, VoiceOver cannot linearize chat content.
-
Custom Gestures Block VoiceOver Rotor and Swipes
Some screens use custom gesture recognizers that override/swallow VoiceOver gestures.
Technical Cause
Gesture recognizers do not respect accessibility:
swift
Copy
gestureRecognizer.cancelsTouchesInView = false
gestureRecognizer.allowedTouchTypes = [NSNumber(value: UITouch.TouchType.direct.rawValue)]
They must implement:
swift
Copy
gestureRecognizer.isAccessibilityElement = false
gestureRecognizer.accessibilityTraits = []
And must not override system gestures required by VoiceOver (swipe left/right). -
Missing Accessibility for Media Elements (Photos, Videos, Attachments)
Media items are announced as “image” without any description.
Fix Example
swift
Copy
imageView.isAccessibilityElement = true
imageView.accessibilityLabel = "Profile photo: John Doe"
imageView.accessibilityTraits = .image
If dynamic alt text is available, it should be provided from metadata. -
Inconsistent Focus Order During Navigation
VoiceOver focus moves unpredictably between UI regions (header → bottom bar → random element).
Technical Cause
Elements are added in a visual order that differs from the accessibility order.
Correct approach:
swift
Copy
view.accessibilityElements = [
headerView,
searchField,
messageListView,
bottomBar
]
This ensures linear reading order. -
Lack of Accessibility for Custom Components
Telegram uses heavy custom UI (animated views, layers, transitions).
If these elements do not expose a semantic role, VoiceOver cannot interpret them.
Fix Approach
For custom containers:
swift
Copy
customView.isAccessibilityElement = true
customView.accessibilityLabel = "Chat options"
customView.accessibilityTraits = [.button]
For toggles/settings:
swift
Copy
toggle.isAccessibilityElement = true
toggle.accessibilityTraits = [.button, isOn ? .selected : []] -
Why the App Is Currently Not Accessible
•
Custom UI elements bypass standard UIKit accessibility.
•
Accessibility tree is incomplete and not ordered.
•
Essential metadata (labels, hints, traits) is missing.
•
Gestures conflict with VoiceOver.
•
Chat screen is built with custom components that are not exposed through UIAccessibilityContainer.
Apple’s accessibility guidelines require all interactive elements to implement:
swift
Copy
isAccessibilityElement
accessibilityLabel
accessibilityHint
accessibilityTraits
Telegram currently violates these requirements in multiple screens. -
How Telegram Can Make the App Accessible (Actionable Fixes)
Audit all UI elements with Apple Accessibility Inspector.
2.
Add proper accessibilityLabel + accessibilityTraits for every button.
3.
Implement UIAccessibilityContainer in all custom message cells.
4.
Ensure focus order with accessibilityElements.
5.
Update custom gesture recognizers so they do not override VoiceOver gestures.
6.
Add alt-text for media items.
7.
Test continuously using VoiceOver’s rotor and swipe navigation.