CalendarDayView

public struct CalendarDayView
extension CalendarDayView: View
extension CalendarDayView: _ViewEmptyChecking

CalendarDayView is used to display a day with title, subtitle and eventIndicator.

Usage

var calendarItemTintAttributes: [CalendarPropertyRef: [CalendarItemControlState: Color]] {
    let result: [CalendarPropertyRef: [CalendarItemControlState: Color]] = [
        .title: [
            .normal: Color(UIColor.blue),
            .disabled: Color(UIColor.red),
            .highlighted: Color(UIColor.green),
            .selected: Color(UIColor.yellow)
        ]
    ]
    return result
}
CalendarDayView(title: "10", subtitle: "22", isEventIndicatorVisible: true, state: .singleSelectedAndToday, customEventView: Rectangle().foregroundStyle(Color.red))
.environment(\.eventViewColor, .red)
.environment(\.selectionSingleColor, .yellow)
.environment(\.calendarItemTintAttributes, calendarItemTintAttributes)

CalendarDayView(title: "10", subtitle: "22", isEventIndicatorVisible: true, state: .disabled)
.environment(\.eventViewColorDisabled, .gray)

CalendarDayView(title: "10", subtitle: "22", isEventIndicatorVisible: true, state: .multiSelectedStart)
.environment(\.selectionRangeColor, .red)