title: SwiftUI running on Simulator/Preview: Toggle not working, console logs: "invalid mode 'kCFRunLoopCommonModes'"
body: <h1>Update: This was a red herring</h1>
  
  <p>So my original question asked how to make a navigation link disabled and only enabled if two <code>Toggle</code> affecting two <code>@State var isXYZToggleOn Bool</code> properties are both <strong>true</strong>. This has always been working, my first attempt using <code>.disabled(!(hasAgreedToTermsAndConditions &amp;&amp; hasAgreedToPrivacyPolicy))</code> was the correct one (also suggested by @superpuccio, but using two negatations and one boolean or (<code>||</code>)).</p>
  
  <p>Turns I did not get my <code>NavigationLink</code> to be enabled because the toggling did not work, not because of incorrect usage of the booleans and <code>disabled</code> view modifier.</p>
  
  <p>Running on device, instead of simulator made everything work! But I still see the warning message as soon as I press any <code>Toggle</code> (but only once):</p>
  
  <pre><code>invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.
  </code></pre>
  
  <p>I get this error message running on simulator too, but then the <code>NavigationLink</code> does not get enabled ever. </p>
  
  <p>I'm running Xcode 5 beta on Catalina 5 beta on a 2016 Macbook Pro. Deleting derived data, restarting Xcode, restarting my computer, resetting the simulator, changing simulator, nothing helps. I still see <code>invalid mode 'kCFRunLoopCommonModes'</code> when I press the first <code>Toggle</code>, and the <code>NavigationLink</code> never gets enabled.</p>
  
  <p>So the new question is:</p>
  
  <h3>Running on simulator: how to solve <code>invalid mode 'kCFRunLoopCommonModes'</code> problem causing my <code>@State</code> bound to <code>Toggle</code> to never become <code>true</code>??</h3>
  
  <h1>Original question</h1>
  
  <p>Using XCode 11 beta 5 and SwiftUI. In a <code>WelcomeScene</code> I have two <code>Toggle</code> views, one toggle for accepting Terms &amp; Conditions and one toggle for Privacy Policy. These toggles updates two separate <code>@State</code> properties respectively. </p>
  
  <p>In the bottom of the scene I have a <code>NagivationLink</code> (button) which will take to the next scene, which I would like to be <strong><em>disabled</em> by default</strong> and only be <em>enabled</em> when <strong>both</strong> <code>hasAgreedToTermsAndConditions</code> and <code>hasAgreedToPrivacyPolicy</code> states are <code>true</code>.</p>
  
  <p>When initiating a <code>NavigationLink</code> there is a <code>isActive</code> argument, which takes a <code>Binding&lt;Bool&gt;</code>, which sounds like the correct thing. However, <code>@Binding</code> properties cannot be marked <code>lazy</code>, thus I cannot make it a computed property being dependent on <code>hasAgreedToTermsAndConditions</code> and <code>hasAgreedToPrivacyPolicy</code>.</p>
  
  <p>There is also a <code>disabled</code> view modifier which takes a <code>Bool</code>, which is also incorrect since it does not get updated... </p>
  
  <pre class="lang-swift prettyprint-override"><code>struct WelcomeScene: View {
  
      @State var hasAgreedToTermsAndConditions: Bool = false
      @State var hasAgreedToPrivacyPolicy: Bool = false
  
      var body: some View {
          VStack {
              Image(named: "MyImage")
  
              Spacer()
  
              Text("Welcome friend!".uppercased())
                  .font(.system(size: 55))
  
              Toggle(isOn: $hasAgreedToTermsAndConditions) {
                  Text("I agree to the Terms and Conditions")
              }.toggleStyle(DefaultToggleStyle())
  
              Toggle(isOn: $hasAgreedToPrivacyPolicy) {
                  Text("I agree to the Privacy Policy")
              }.toggleStyle(DefaultToggleStyle())
  
              // This does not compile 'Binding&lt;Bool&gt; is not convertible to Bool', but I cannot figure out how to create a compupted property binding using those 2 states...
              NavigationLink("Proceed", destination: SignInScene(), isActive: ($hasAgreedToTermsAndConditions &amp;&amp; $hasAgreedToPrivacyPolicy))
          }.padding(30)
      }
  }
  </code></pre>
  
  How can I make a <code>NavigationLink</code> <code>disabled</code> by default and only <code>enabled</code> when both toggles are <code>on</code>?