diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift index e85dc751..5ac143f6 100644 --- a/VDS/Components/Icon/Icon.swift +++ b/VDS/Components/Icon/Icon.swift @@ -44,6 +44,7 @@ open class Icon: View { //-------------------------------------------------- /// UIImageView used to render the icon. open var imageView = UIImageView().with { + $0.isAccessibilityElement = false $0.translatesAutoresizingMaskIntoConstraints = false $0.contentMode = .scaleAspectFill $0.clipsToBounds = true @@ -78,7 +79,7 @@ open class Icon: View { /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() - + setContentCompressionResistancePriority(.required, for: .vertical) setContentHuggingPriority(.required, for: .vertical) setContentCompressionResistancePriority(.required, for: .horizontal) @@ -123,6 +124,11 @@ open class Icon: View { color = VDSColor.paletteBlack imageView.image = nil } + + open override func updateAccessibility() { + super.updateAccessibility() + accessibilityLabel = name?.rawValue ?? "icon" + } //-------------------------------------------------- // MARK: - Private Methods