Skip to content

Commit 0e210c8

Browse files
committed
[Fix] HomeView
1 parent c65728f commit 0e210c8

2 files changed

Lines changed: 365 additions & 273 deletions

File tree

ComfortableMove/ComfortableMove/Core/Extensions/View+Accessibility.swift

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,37 @@ struct A11yLabels {
9999
static let notificationButtonValueUnselected = "비활성화됨"
100100

101101
// MARK: - Bus Selection
102-
static func busSelection(routeName: String, isSelected: Bool) -> String {
103-
"\(routeName)번 버스 선택"
102+
static func busSelection(routeName: String, busType: String, arrivalMsg: String?, congestion: String?, direction: String?, isSelected: Bool) -> String {
103+
var msg = ""
104+
105+
// 버스 번호와 종류
106+
if !busType.isEmpty {
107+
msg += "\(routeName)\(busType) 버스, "
108+
} else {
109+
msg += "\(routeName)번 버스, "
110+
}
111+
112+
// 방면
113+
if let dir = direction {
114+
msg += "\(dir) 방면, "
115+
}
116+
117+
// 도착 정보
118+
if let arrival = arrivalMsg {
119+
msg += "\(arrival), "
120+
}
121+
122+
// 혼잡도
123+
if let cong = congestion {
124+
msg += "혼잡도는 \(cong)입니다, "
125+
}
126+
127+
// 선택 상태
128+
msg += isSelected ? "선택됨" : "선택 안 됨"
129+
130+
return msg
104131
}
105-
132+
106133
static func busSelectionValue(isSelected: Bool) -> String {
107134
isSelected ? "선택됨" : "선택 안 됨"
108135
}
@@ -206,4 +233,36 @@ struct A11yLabels {
206233
msg += " 배려석 알림 전송 버튼이 활성화되었습니다."
207234
return msg
208235
}
236+
237+
// MARK: - Bus Info Label (자연스러운 음성 안내)
238+
static func busInfoLabel(routeName: String, busType: String, arrivalMsg: String?, congestion: String?, direction: String?) -> String {
239+
var msg = ""
240+
241+
// 버스 번호와 종류
242+
if !busType.isEmpty {
243+
msg += "\(routeName)\(busType) 버스, "
244+
} else {
245+
msg += "\(routeName)번 버스, "
246+
}
247+
248+
// 방면
249+
if let dir = direction {
250+
msg += "\(dir) 방면, "
251+
}
252+
253+
// 도착 정보
254+
if let arrival = arrivalMsg {
255+
msg += "\(arrival), "
256+
}
257+
258+
// 혼잡도
259+
if let cong = congestion {
260+
msg += "혼잡도는 \(cong)입니다"
261+
} else {
262+
// 마지막 쉼표 제거
263+
msg = msg.trimmingCharacters(in: CharacterSet(charactersIn: ", "))
264+
}
265+
266+
return msg
267+
}
209268
}

0 commit comments

Comments
 (0)