mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-28 02:51:02 +00:00
Improve attachment upload accessibility labels
This commit is contained in:
parent
a4d2e89296
commit
20bbf5e5df
2 changed files with 6 additions and 1 deletions
|
@ -98,6 +98,7 @@ final class EditAttachmentViewController: UIViewController {
|
||||||
textView.layer.cornerRadius = .defaultCornerRadius
|
textView.layer.cornerRadius = .defaultCornerRadius
|
||||||
textView.delegate = self
|
textView.delegate = self
|
||||||
textView.text = viewModel.editingDescription
|
textView.text = viewModel.editingDescription
|
||||||
|
textView.accessibilityLabel = describeLabel.text
|
||||||
|
|
||||||
let remainingCharactersLabel = UILabel()
|
let remainingCharactersLabel = UILabel()
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,6 @@ private extension AttachmentView {
|
||||||
addSubview(selectionButton)
|
addSubview(selectionButton)
|
||||||
selectionButton.translatesAutoresizingMaskIntoConstraints = false
|
selectionButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
selectionButton.setBackgroundImage(.highlightedButtonBackground, for: .highlighted)
|
selectionButton.setBackgroundImage(.highlightedButtonBackground, for: .highlighted)
|
||||||
selectionButton.accessibilityLabel = NSLocalizedString("compose.attachment.edit", comment: "")
|
|
||||||
selectionButton.addAction(
|
selectionButton.addAction(
|
||||||
UIAction { [weak self] _ in
|
UIAction { [weak self] _ in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
|
@ -143,6 +142,11 @@ private extension AttachmentView {
|
||||||
self.parentViewModel.attachmentSelected(viewModel: self.viewModel)
|
self.parentViewModel.attachmentSelected(viewModel: self.viewModel)
|
||||||
},
|
},
|
||||||
for: .touchUpInside)
|
for: .touchUpInside)
|
||||||
|
selectionButton.accessibilityLabel = NSLocalizedString("compose.attachment.edit", comment: "")
|
||||||
|
|
||||||
|
if let description = viewModel.attachment.description, !description.isEmpty {
|
||||||
|
selectionButton.accessibilityLabel?.appendWithSeparator(description)
|
||||||
|
}
|
||||||
|
|
||||||
addSubview(removeButton)
|
addSubview(removeButton)
|
||||||
removeButton.translatesAutoresizingMaskIntoConstraints = false
|
removeButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
|
Loading…
Reference in a new issue