mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
Improve Voice Over experience on Followers and Following lists
Fixes IOS-394
This commit is contained in:
parent
c809d18d97
commit
d73e318c39
@ -65,5 +65,11 @@ extension UserView {
|
||||
authorVerifiedLabel.configure(content: PlaintextMetaContent(string: L10n.Common.UserList.noVerifiedLink))
|
||||
authorVerifiedLabel.textColor = .secondaryLabel
|
||||
}
|
||||
|
||||
configureA11y(displayName: account.displayNameWithFallback, userName: "@\(account.username)", followersCountLabel: L10n.Common.UserList.followersCount(count))
|
||||
}
|
||||
|
||||
func configureA11y(displayName: String, userName: String, followersCountLabel: String) {
|
||||
accessibilityLabel = "\(displayName), \(userName), \(followersCountLabel)"
|
||||
}
|
||||
}
|
||||
|
@ -66,8 +66,5 @@ extension UserTableViewCell {
|
||||
separatorLine.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
|
||||
separatorLine.heightAnchor.constraint(equalToConstant: UIView.separatorLineHeight(of: contentView)).priority(.required - 1),
|
||||
])
|
||||
|
||||
userView.accessibilityTraits.insert(.button)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -345,6 +345,16 @@ public extension UserView {
|
||||
}
|
||||
|
||||
followButton.addTarget(self, action: #selector(didTapFollowButton), for: .touchUpInside)
|
||||
|
||||
accessibilityHint = L10n.Common.Controls.Status.showUserProfile
|
||||
guard let followButtonLabel = followButton.configuration?.title, !followButton.isHidden, followButton.isEnabled else { accessibilityCustomActions = []; return }
|
||||
accessibilityCustomActions = [
|
||||
UIAccessibilityCustomAction(name: followButtonLabel) { [weak self] action in
|
||||
guard let self else { return false }
|
||||
self.didTapFollowButton()
|
||||
return true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user