How can I use the @Environment(\.calendar) in a View to initialize a @State variable?

前端 未结 0 995
一生所求
一生所求 2021-01-23 04:18

I have a calendar view like so:

struct CalendarView: View {
    @Environment(\\.calendar) var calendar
    @State var daysForMonthView: [DateInterval]
    ...
}
<         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题