Fix VoiceOver reading profile field names/values in incorrect order

This commit is contained in:
Shadowfacts 2021-06-06 22:35:15 -04:00
parent 0566f0ddfa
commit ef1db466b9
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 12 additions and 0 deletions

View File

@ -132,6 +132,7 @@ class ProfileHeaderView: UIView {
fieldNamesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() } fieldNamesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
fieldValuesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() } fieldValuesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() }
var fieldAccessibilityElements = [Any]()
for field in account.fields { for field in account.fields {
let nameLabel = EmojiLabel() let nameLabel = EmojiLabel()
nameLabel.text = field.name nameLabel.text = field.name
@ -155,7 +156,18 @@ class ProfileHeaderView: UIView {
fieldValuesStackView.addArrangedSubview(valueTextView) fieldValuesStackView.addArrangedSubview(valueTextView)
nameLabel.heightAnchor.constraint(equalTo: valueTextView.heightAnchor).isActive = true nameLabel.heightAnchor.constraint(equalTo: valueTextView.heightAnchor).isActive = true
fieldAccessibilityElements.append(nameLabel)
fieldAccessibilityElements.append(valueTextView)
} }
accessibilityElements = [
displayNameLabel!,
usernameLabel!,
noteTextView!,
] + fieldAccessibilityElements + [
moreButton!,
pagesSegmentedControl!,
]
} }
private func updateRelationship() { private func updateRelationship() {