Merge pull request #2308 from rizwankce/fix-timeline-title-view-a11y
Fix a11y for title view of timeline view controller
This commit is contained in:
commit
9d46bfdd9c
|
@ -19,6 +19,19 @@ class MasterTimelineTitleView: UIView {
|
||||||
UIPointerInteraction(delegate: self)
|
UIPointerInteraction(delegate: self)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
override var accessibilityLabel: String? {
|
||||||
|
set { }
|
||||||
|
get {
|
||||||
|
if let name = label.text {
|
||||||
|
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity")
|
||||||
|
return "\(name) \(unreadCountView.unreadCount) \(unreadLabel)"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func buttonize() {
|
func buttonize() {
|
||||||
heightAnchor.constraint(equalToConstant: 40.0).isActive = true
|
heightAnchor.constraint(equalToConstant: 40.0).isActive = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
|
@ -28,6 +41,7 @@ class MasterTimelineTitleView: UIView {
|
||||||
}
|
}
|
||||||
|
|
||||||
func debuttonize() {
|
func debuttonize() {
|
||||||
|
heightAnchor.constraint(equalToConstant: 40.0).isActive = true
|
||||||
accessibilityTraits.remove(.button)
|
accessibilityTraits.remove(.button)
|
||||||
if #available(iOS 13.4, *) {
|
if #available(iOS 13.4, *) {
|
||||||
removeInteraction(pointerInteraction)
|
removeInteraction(pointerInteraction)
|
||||||
|
|
Loading…
Reference in New Issue