Skip to content

Commit

Permalink
#21 Calendar Click event & Color
Browse files Browse the repository at this point in the history
- 달력에 색 채우기
- 달력 클릭
  • Loading branch information
JUNY0110 committed Nov 19, 2022
1 parent 58cdccd commit a0b94fc
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ThrowAway/ThrowAway/SwiftUI/StaticsView/View/CalendarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import SwiftUI

struct CalendarView: View {
@EnvironmentObject var dateHolder: DateHolder
@State private var selection: Bool? = false
@State private var columnIndex = 0
@State private var rowIndex = 0

var body: some View {
VStack {
Expand All @@ -26,7 +29,22 @@ struct CalendarView: View {
startingSpaces: startingSpaces,
daysInMonth: daysInMonth,
daysInPrevMonth: daysInPrevMonth
).environmentObject(dateHolder)
)
.background(Color.green)
.onTapGesture{

// TODO: - selection된 것에 따라 팝업 띄우기

self.selection = true

// TODO: - 선택한 날짜

self.rowIndex = row
self.columnIndex = column
print([rowIndex, columnIndex])
print(count - startingSpaces)
}
.environmentObject(dateHolder)
}
}
}
Expand Down

0 comments on commit a0b94fc

Please sign in to comment.