From ef1db466b9519c1260ab5fbf9a04d9f581700853 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 6 Jun 2021 22:35:15 -0400 Subject: [PATCH] Fix VoiceOver reading profile field names/values in incorrect order --- Tusker/Views/Profile Header/ProfileHeaderView.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tusker/Views/Profile Header/ProfileHeaderView.swift b/Tusker/Views/Profile Header/ProfileHeaderView.swift index 7729e7bf..700d9666 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderView.swift +++ b/Tusker/Views/Profile Header/ProfileHeaderView.swift @@ -132,6 +132,7 @@ class ProfileHeaderView: UIView { fieldNamesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() } fieldValuesStackView.arrangedSubviews.forEach { $0.removeFromSuperview() } + var fieldAccessibilityElements = [Any]() for field in account.fields { let nameLabel = EmojiLabel() nameLabel.text = field.name @@ -155,7 +156,18 @@ class ProfileHeaderView: UIView { fieldValuesStackView.addArrangedSubview(valueTextView) nameLabel.heightAnchor.constraint(equalTo: valueTextView.heightAnchor).isActive = true + fieldAccessibilityElements.append(nameLabel) + fieldAccessibilityElements.append(valueTextView) } + + accessibilityElements = [ + displayNameLabel!, + usernameLabel!, + noteTextView!, + ] + fieldAccessibilityElements + [ + moreButton!, + pagesSegmentedControl!, + ] } private func updateRelationship() {