title: How can I use the @Environment(\.calendar) in a View to initialize a @State variable?
body: <p>I have a calendar view like so:</p>
  <pre><code>struct CalendarView: View {
      @Environment(\.calendar) var calendar
      @State var daysForMonthView: [DateInterval]
      ...
  }
  </code></pre>
  <p>where i need to initialize the <code>daysForMonthView</code> array by using the <code>@Environment(\.calendar)</code>. How can I do that?</p>
  <p>Trying to do:</p>
  <pre><code>init() {
      _daysForMonthView = State(initialValue: calendar.daysForMonthViewContaining(date: Date()))
  }
  </code></pre>
  <p>produces a <code>Variable 'self.daysForMonthView' used before being initialized</code> -error.</p>