Skip to content

Commit 066ef0d

Browse files
committed
Add a label for VoiceOver to read in place of the Note's attributed string.
1 parent fd7a5d7 commit 066ef0d

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class BloggingPromptsFeatureDescriptionView: UIView, NibLoadable {
77
@IBOutlet private weak var promptCardView: UIView!
88
@IBOutlet private weak var descriptionLabel: UILabel!
99
@IBOutlet private weak var noteTextView: UITextView!
10+
@IBOutlet private weak var noteAccessibilityLabel: UILabel!
1011

1112
// MARK: - Init
1213

@@ -71,12 +72,16 @@ private extension BloggingPromptsFeatureDescriptionView {
7172
.font: UIFont.preferredFont(forTextStyle: .caption1)]))
7273

7374
noteTextView.attributedText = attributedString
75+
76+
noteTextView.accessibilityElementsHidden = true
77+
noteAccessibilityLabel.accessibilityLabel = Strings.noteTextAccessibilityLabel
7478
}
7579

7680
enum Strings {
7781
static let featureDescription: String = NSLocalizedString("We’ll show you a new prompt each day on your dashboard to help get those creative juices flowing!", comment: "Description of Blogging Prompts displayed in the Feature Introduction view.")
7882
static let noteLabel: String = NSLocalizedString("Note:", comment: "Label for the note displayed in the Feature Introduction view.")
7983
static let noteText: String = NSLocalizedString("You can learn more and set up reminders at any time in My Site > Settings > Blogging Reminders.", comment: "Note displayed in the Feature Introduction view.")
84+
static let noteTextAccessibilityLabel: String = NSLocalizedString("You can learn more and set up reminders at any time in My Site, Settings, Blogging Reminders.", comment: "Accessibility hint for Note displayed in the Feature Introduction view.")
8085
}
8186

8287
enum Style {

WordPress/Classes/ViewRelated/Feature Introduction/Blogging Prompts/BloggingPromptsFeatureDescriptionView.xib

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8JU-nl-SWR" userLabel="Prompt Card">
1919
<rect key="frame" x="52" y="0.0" width="310.5" height="200.5"/>
2020
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
21+
<accessibility key="accessibilityConfiguration">
22+
<accessibilityTraits key="traits" notEnabled="YES"/>
23+
</accessibility>
2124
<constraints>
2225
<constraint firstAttribute="height" relation="greaterThanOrEqual" id="BfW-eb-ZtV"/>
2326
</constraints>
@@ -31,28 +34,44 @@
3134
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" editable="NO" text="Note: You can learn more and set up reminders at any time in My Site &gt; Settings &gt; Blogging Reminders." textAlignment="natural" adjustsFontForContentSizeCategory="YES" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z9E-X2-t3c" userLabel="Note">
3235
<rect key="frame" x="16" y="284.5" width="382" height="42.5"/>
3336
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
37+
<accessibility key="accessibilityConfiguration">
38+
<accessibilityTraits key="traits" notEnabled="YES"/>
39+
<bool key="isElement" value="NO"/>
40+
</accessibility>
3441
<color key="textColor" systemColor="secondaryLabelColor"/>
3542
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption1"/>
3643
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
3744
</textView>
45+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ART-X9-BCw" userLabel="Note Accessibility Label">
46+
<rect key="frame" x="16" y="284.5" width="382" height="42.5"/>
47+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
48+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
49+
<nil key="textColor"/>
50+
<nil key="highlightedColor"/>
51+
</label>
3852
</subviews>
3953
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
4054
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
4155
<constraints>
4256
<constraint firstItem="z9E-X2-t3c" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="16" id="1K2-WJ-vdn"/>
4357
<constraint firstItem="8JU-nl-SWR" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" multiplier="0.75" id="4C5-B7-SUy"/>
58+
<constraint firstItem="ART-X9-BCw" firstAttribute="leading" secondItem="z9E-X2-t3c" secondAttribute="leading" id="8Qb-0Z-rT5"/>
4459
<constraint firstItem="8JU-nl-SWR" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="95d-85-VYs"/>
4560
<constraint firstAttribute="bottom" secondItem="z9E-X2-t3c" secondAttribute="bottom" id="IUZ-vA-5QN"/>
4661
<constraint firstItem="1gW-xt-yLe" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="16" id="WJ4-xD-ctR"/>
62+
<constraint firstItem="ART-X9-BCw" firstAttribute="trailing" secondItem="z9E-X2-t3c" secondAttribute="trailing" id="lKl-p8-5Ty"/>
4763
<constraint firstItem="8JU-nl-SWR" firstAttribute="centerX" secondItem="vUN-kp-3ea" secondAttribute="centerX" id="sjz-gT-pc8"/>
4864
<constraint firstAttribute="trailing" secondItem="1gW-xt-yLe" secondAttribute="trailing" constant="16" id="srn-mJ-gKe"/>
4965
<constraint firstAttribute="trailing" secondItem="z9E-X2-t3c" secondAttribute="trailing" constant="16" id="vmH-4q-pbI"/>
66+
<constraint firstItem="ART-X9-BCw" firstAttribute="bottom" secondItem="z9E-X2-t3c" secondAttribute="bottom" id="wAs-7B-QAX"/>
5067
<constraint firstItem="z9E-X2-t3c" firstAttribute="top" secondItem="1gW-xt-yLe" secondAttribute="bottom" constant="24" id="wED-RV-9Lf"/>
68+
<constraint firstItem="ART-X9-BCw" firstAttribute="top" secondItem="z9E-X2-t3c" secondAttribute="top" id="xiL-2a-FCO"/>
5169
<constraint firstItem="1gW-xt-yLe" firstAttribute="top" secondItem="8JU-nl-SWR" secondAttribute="bottom" constant="24" id="yAr-WH-wmx"/>
5270
</constraints>
5371
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
5472
<connections>
5573
<outlet property="descriptionLabel" destination="1gW-xt-yLe" id="rot-qA-zIV"/>
74+
<outlet property="noteAccessibilityLabel" destination="ART-X9-BCw" id="cbu-ST-2Qk"/>
5675
<outlet property="noteTextView" destination="z9E-X2-t3c" id="GcN-mv-lZH"/>
5776
<outlet property="promptCardView" destination="8JU-nl-SWR" id="tY3-0q-Bn3"/>
5877
</connections>

0 commit comments

Comments
 (0)