Skip to content

Commit 81ff489

Browse files
authored
Merge pull request #207 from mattrubin/accessibility
Improve button accessibility
2 parents 2f72c1a + f68d0c0 commit 81ff489

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Authenticator/Source/TokenListViewController.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class TokenListViewController: UITableViewController {
7474
self.noTokensLabel.autoresizingMask = [.flexibleWidth, .flexibleHeight]
7575
button.addSubview(self.noTokensLabel)
7676

77+
button.accessibilityLabel = "No Tokens"
78+
button.accessibilityHint = "Double-tap to add a new token."
79+
7780
return button
7881
}()
7982

@@ -108,6 +111,9 @@ class TokenListViewController: UITableViewController {
108111
self.backupWarningLabel.autoresizingMask = [.flexibleWidth, .flexibleHeight]
109112
button.addSubview(self.backupWarningLabel)
110113

114+
button.accessibilityLabel = "For security reasons, tokens will be stored only on this \(UIDevice.current.model), and will not be included in iCloud or unencrypted backups."
115+
button.accessibilityHint = "Double-tap to learn more."
116+
111117
return button
112118
}()
113119

Authenticator/Source/TokenRowCell.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class TokenRowCell: UITableViewCell {
6868

6969
nextPasswordButton.tintColor = .otpForegroundColor
7070
nextPasswordButton.addTarget(self, action: #selector(TokenRowCell.generateNextPassword), for: .touchUpInside)
71+
nextPasswordButton.accessibilityLabel = "Increment token"
72+
nextPasswordButton.accessibilityHint = "Double-tap to generate a new password."
7173
contentView.addSubview(nextPasswordButton)
7274
}
7375

Authenticator/Source/TokenScannerViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ final class TokenScannerViewController: UIViewController, QRScannerDelegate {
6464
self.permissionLabel.autoresizingMask = [.flexibleWidth, .flexibleHeight]
6565
button.addSubview(self.permissionLabel)
6666

67+
button.accessibilityLabel = "To add a new token via QR code, Authenticator needs permission to access the camera."
68+
button.accessibilityHint = "Double-tap to go to Settings."
69+
6770
return button
6871
}()
6972

0 commit comments

Comments
 (0)