Skip to content

Commit 558b9ae

Browse files
committed
Add accessibility labels and hints to custom buttons
1 parent 2f72c1a commit 558b9ae

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-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/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)