Additional accessibilityLabels for VoiceOver users (take #2)

This commit is contained in:
gitbisector 2025-05-11 16:12:34 -07:00
parent f56f3723ee
commit 5cccdcea22
14 changed files with 905 additions and 164 deletions

View file

@ -115,6 +115,17 @@ extension String {
.joined()
}
/// Formats a short name like "P130" to read as "Node P 130" for VoiceOver
/// This ensures proper pronunciation of alphanumeric node IDs
func formatNodeNameForVoiceOver() -> String {
let spaced = self.replacingOccurrences(
of: #"([A-Za-z])([0-9]+)"#,
with: "$1 $2",
options: .regularExpression
)
return "Node " + spaced
}
// Adds variation selectors to prefer the graphical form of emoji.
// Looks ahead to make sure that the variation selector is not already applied.
var addingVariationSelectors: String {