customized accessibility for cell
This commit is contained in:
parent
9b570c1a9a
commit
8e47e4ceb3
@ -127,7 +127,7 @@ import UIKit
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
if let state = MVMCoreUIUtility.hardcodedString(withKey: isSelected ? "radio_selected_state" : "radio_not_selected_state") {
|
||||
accessibilityLabel = String(format: MVMCoreUIUtility.hardcodedString(withKey: "radio_desc_state") ?? "%@%@", "", state)
|
||||
accessibilityLabel = state
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -77,13 +77,13 @@ import UIKit
|
||||
}
|
||||
|
||||
public override func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
radioButton.tapAction()
|
||||
radioButton.tapAction()
|
||||
}
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
var message = "Radio Button, "
|
||||
|
||||
|
||||
if let radioButtonLabel = radioButton.accessibilityLabel {
|
||||
message += radioButtonLabel + ", "
|
||||
}
|
||||
@ -100,10 +100,10 @@ import UIKit
|
||||
message += headlineLabel + ", "
|
||||
}
|
||||
|
||||
if let bodyLabel = eyebrowHeadlineBodyLink.eyebrow.text {
|
||||
if let bodyLabel = eyebrowHeadlineBodyLink.body.text {
|
||||
message += bodyLabel
|
||||
}
|
||||
|
||||
|
||||
accessibilityLabel = message
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,11 +301,13 @@
|
||||
[weakSelf.viewToLayout layoutIfNeeded];
|
||||
};
|
||||
|
||||
//accessibility - added to make only top alert label and close button accessible. Posted notification when top alert is displayed
|
||||
weakSelf.accessibilityElements = @[weakSelf.buttonView];
|
||||
weakSelf.shortView.isAccessibilityElement = NO;
|
||||
weakSelf.buttonView.label.accessibilityLabel = [NSString stringWithFormat:@"%@ - %@", [MVMCoreUIUtility hardcodedStringWithKey:@"top_alert_notification"],weakSelf.buttonView.label.accessibilityLabel];
|
||||
|
||||
void(^completion)(void) = ^(void) {
|
||||
//accessibility - added to make only top alert label and close button accessible. Posted notification when top alert is displayed
|
||||
weakSelf.accessibilityElements = @[weakSelf.buttonView];
|
||||
weakSelf.shortView.isAccessibilityElement = NO;
|
||||
weakSelf.buttonView.label.accessibilityLabel = [NSString stringWithFormat:@"%@ - %@", [MVMCoreUIUtility hardcodedStringWithKey:@"top_alert_notification"],weakSelf.buttonView.label.accessibilityLabel];
|
||||
|
||||
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, weakSelf.buttonView.label);
|
||||
[operation markAsFinished];
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user