Zum Inhalt

apple/PhysarumApp/Sources/UI/A11y.swift

import Foundation

/// Pure VoiceOver value/label helpers — the logic-bearing transforms used by the
/// inline `.accessibilityValue`/`.accessibilityLabel` passes. Kept pure so the
/// announced strings are unit-testable (the SwiftUI modifiers themselves are not).
enum A11y {
    static func onOff(_ on: Bool) -> String { on ? "On" : "Off" }
    static func locked(_ locked: Bool) -> String { locked ? "Locked" : "Unlocked" }
    static func pinned(_ pinned: Bool) -> String { pinned ? "Pinned" : "Not pinned" }
    static func selected(_ selected: Bool) -> String { selected ? "Selected" : "Not selected" }

    static let canvasLabel = "Physarum simulation"
    static func canvasValue(presetName: String) -> String { presetName }
}