From 2c7666c2141f11e3f26a271f22acd0be29c535fc Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 31 Jul 2023 13:42:37 -0500 Subject: [PATCH] helper for text Signed-off-by: Matt Bruce --- VDS/Components/Tooltip/Tooltip.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/VDS/Components/Tooltip/Tooltip.swift b/VDS/Components/Tooltip/Tooltip.swift index 8010a81f..6d88fca2 100644 --- a/VDS/Components/Tooltip/Tooltip.swift +++ b/VDS/Components/Tooltip/Tooltip.swift @@ -183,6 +183,20 @@ open class Tooltip: Control, TooltipLaunchable { accessibilityLabel = label } } + + public static func accessibleText(for title: String?, content: String?, closeButtonText: String) -> String { + var label = "" + if let title { + label = title + } + if let content { + if !label.isEmpty { + label += "," + } + label += content + } + return label + } }