title: How to use EnvironmentObject to initialize State Property in SwiftUI?
body: <p>I am having a small Issue with initializing a <code>State</code> with Data from an <code>EnvironmentObject</code>.</p>
  <pre class="lang-swift prettyprint-override"><code>@EnvironmentObject var settings: Settings
      
  @State var localAllowReminders: Bool
      
  init() {
      self._localAllowReminders = State(initialValue: settings.allowReminders)
  }
  </code></pre>
  <blockquote>
  <p>Obviously, I get the following Error Message: <strong>'self' used before all stored properties are initialized.</strong></p>
  </blockquote>
  <p><strong>Question:</strong> How can I initialize a State with Data out of a EnvironmentObject?</p>
  <p>Thanks for your help.</p>