@@ -38,12 +38,14 @@ @implementation RNNTitleViewHelper
38
38
39
39
- (instancetype )initWithTitleViewOptions : (RNNTitleOptions *)titleOptions
40
40
subTitleOptions : (RNNSubtitleOptions *)subtitleOptions
41
+ parentTestID : (Text *)parentTestID
41
42
viewController : (UIViewController *)viewController {
42
43
self = [super init ];
43
44
if (self) {
44
45
self.viewController = viewController;
45
46
self.titleOptions = titleOptions;
46
47
self.subtitleOptions = subtitleOptions;
48
+ self.parentTestID = parentTestID;
47
49
}
48
50
return self;
49
51
}
@@ -81,7 +83,7 @@ - (void)setup {
81
83
if (self.title ) {
82
84
self.titleView .titleLabel = [self setupTitle ];
83
85
}
84
-
86
+
85
87
[self centerTitleView: navigationBarBounds
86
88
titleLabel: self .titleView.titleLabel
87
89
subtitleLabel: self .titleView.subtitleLabel];
@@ -134,6 +136,10 @@ - (UILabel *)setupSubtitle {
134
136
UIColor *color = _subtitleOptions.color .get ;
135
137
subtitleLabel.textColor = color;
136
138
}
139
+
140
+ if (_parentTestID && _parentTestID.hasValue && ((NSString *) _parentTestID.get ).length > 0 ) {
141
+ subtitleLabel.accessibilityLabel = [NSString stringWithFormat: @" %@ .subtitle" , _parentTestID.get];
142
+ }
137
143
138
144
[self .titleView addSubview: subtitleLabel];
139
145
@@ -174,6 +180,10 @@ - (UILabel *)setupTitle {
174
180
titleLabel.textColor = color;
175
181
}
176
182
183
+ if (_parentTestID && _parentTestID.hasValue && ((NSString *) _parentTestID.get ).length > 0 ) {
184
+ titleLabel.accessibilityLabel = [NSString stringWithFormat: @" %@ .title" , _parentTestID.get];
185
+ }
186
+
177
187
[self .titleView addSubview: titleLabel];
178
188
179
189
return titleLabel;
0 commit comments