From 303554462ce1982be08e9964344757d2c6565bc0 Mon Sep 17 00:00:00 2001 From: Krishna Kishore Bandaru Date: Mon, 25 Mar 2024 19:12:47 +0530 Subject: [PATCH] accessibility fixes for Notification --- VDS/Components/Notification/Notification.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/VDS/Components/Notification/Notification.swift b/VDS/Components/Notification/Notification.swift index 126f83f0..ce2775d0 100644 --- a/VDS/Components/Notification/Notification.swift +++ b/VDS/Components/Notification/Notification.swift @@ -338,6 +338,16 @@ open class Notification: View { layer.cornerRadius = UIScreen.main.bounds.width == bounds.width ? 0 : 4.0 } + ///Updating the accessiblity values i.e elements, label, value other items for the component. + open override func updateAccessibility() { + super.updateAccessibility() + accessibilityElements = [closeButton, typeIcon, titleLabel, subTitleLabel, buttonGroup] + typeIcon.accessibilityLabel = style.rawValue + typeIcon.imageView.image?.isAccessibilityElement = false + closeButton.accessibilityTraits = [.button] + closeButton.accessibilityLabel = "Close Notification" + } + //-------------------------------------------------- // MARK: - Private Methods //--------------------------------------------------