Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ final class BitnagilCalendarView: UIViewController {
configureCalendar()
configureConfirmButton()

prevButton.addAction(
UIAction{ [weak self] _ in
self?.moveMonth(offset: -1)
},
for: .touchUpInside)

nextButton.addAction(
UIAction{ [weak self] _ in
self?.moveMonth(offset: 1)
},
for: .touchUpInside)
Comment on lines +50 to +60
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

접근성 레이블이 없어 월 이동 버튼을 식별하기 어렵습니다.

이제 버튼이 실제 동작을 가지므로 VoiceOver 사용자는 기능을 구분할 수 있어야 합니다. prevButton/nextButton에 접근성 레이블을 명시해 주세요.

✅ 제안 수정
         prevButton.addAction(
             UIAction{ [weak self] _ in
                 self?.moveMonth(offset: -1)
             },
             for: .touchUpInside)
+        prevButton.isAccessibilityElement = true
+        prevButton.accessibilityLabel = "이전 달"
+        prevButton.accessibilityTraits = .button

         nextButton.addAction(
             UIAction{ [weak self] _ in
                 self?.moveMonth(offset: 1)
             },
             for: .touchUpInside)
+        nextButton.isAccessibilityElement = true
+        nextButton.accessibilityLabel = "다음 달"
+        nextButton.accessibilityTraits = .button
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
prevButton.addAction(
UIAction{ [weak self] _ in
self?.moveMonth(offset: -1)
},
for: .touchUpInside)
nextButton.addAction(
UIAction{ [weak self] _ in
self?.moveMonth(offset: 1)
},
for: .touchUpInside)
prevButton.addAction(
UIAction{ [weak self] _ in
self?.moveMonth(offset: -1)
},
for: .touchUpInside)
prevButton.isAccessibilityElement = true
prevButton.accessibilityLabel = "이전 달"
prevButton.accessibilityTraits = .button
nextButton.addAction(
UIAction{ [weak self] _ in
self?.moveMonth(offset: 1)
},
for: .touchUpInside)
nextButton.isAccessibilityElement = true
nextButton.accessibilityLabel = "다음 달"
nextButton.accessibilityTraits = .button
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Projects/Presentation/Sources/RoutineCreation/View/Component/BitnagilCalendarView.swift`
around lines 50 - 60, The prevButton and nextButton lack accessibility labels,
making them indistinguishable to VoiceOver users; update the
BitnagilCalendarView initialization where prevButton and nextButton are
configured to set meaningful accessibility properties (e.g., set
accessibilityLabel to localized strings like "Previous month" and "Next month",
optionally set accessibilityHint and accessibilityTraits = .button, and/or set
accessibilityIdentifier for testing) so that users can identify the month
navigation actions triggered by moveMonth(offset:).


let dateString = Date().convertToString(dateType: .yearMonth)
dateLabel.text = dateString
dateLabel.font = BitnagilFont.init(style: .title2, weight: .bold).font
Expand Down Expand Up @@ -143,10 +155,27 @@ final class BitnagilCalendarView: UIViewController {
},
for: .touchUpInside)
}

private func moveMonth(offset: Int) {
let currentPage = calendarView.currentPage
guard let targetDate = Calendar.current.date(
byAdding: .month,
value: offset,
to: currentPage) else { return }
calendarView.setCurrentPage(targetDate, animated: true)
}

private func updateDateLabel(with date: Date) {
dateLabel.text = date.convertToString(dateType: .yearMonth)
}
}

extension BitnagilCalendarView: FSCalendarDelegate {
func calendar(_ calendar: FSCalendar, didSelect date: Date, at monthPosition: FSCalendarMonthPosition) {
delegate?.bitnagilCalendarView(self, didSelectDate: date)
}

func calendarCurrentPageDidChange(_ calendar: FSCalendar) {
updateDateLabel(with: calendar.currentPage)
}
}
Loading