Skip to content

Commit 3e9a51f

Browse files
authored
Merge pull request #239 from mattrubin/voiceover
Improve VoiceOver for token entry
2 parents c5cb2ab + 5d09cb0 commit 3e9a51f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Authenticator/Source/TextFieldRow.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class TextFieldRowCell<Action>: UITableViewCell, UITextFieldDelegate {
7373
textField.borderStyle = .roundedRect
7474
textField.font = UIFont.systemFont(ofSize: 16, weight: UIFontWeightLight)
7575
contentView.addSubview(textField)
76+
77+
accessibilityElements = [textField]
7678
}
7779

7880
override func layoutSubviews() {
@@ -101,6 +103,8 @@ class TextFieldRowCell<Action>: UITableViewCell, UITextFieldDelegate {
101103
textField.text = viewModel.value
102104
}
103105
changeAction = viewModel.changeAction
106+
107+
textField.accessibilityLabel = viewModel.label
104108
}
105109

106110
static func heightWithViewModel(_ viewModel: TextFieldRowViewModel<Action>) -> CGFloat {

Authenticator/Source/TokenScannerViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ final class TokenScannerViewController: UIViewController, QRScannerDelegate {
9999
target: self,
100100
action: #selector(TokenScannerViewController.cancel)
101101
)
102-
navigationItem.rightBarButtonItem = UIBarButtonItem(
102+
let manualEntryBarButtonItem = UIBarButtonItem(
103103
barButtonSystemItem: .compose,
104104
target: self,
105105
action: #selector(TokenScannerViewController.addTokenManually)
106106
)
107+
manualEntryBarButtonItem.accessibilityLabel = "Manual token entry"
108+
navigationItem.rightBarButtonItem = manualEntryBarButtonItem
107109

108110
videoLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
109111
videoLayer.frame = view.layer.bounds

0 commit comments

Comments
 (0)