title: Manually set light/dark mode in SwiftUI and save users choice
body: <p>I found a solution to manually set light/dark mode in a swiftui app in another thread found here <a href="https://stackoverflow.com/a/58476468/11698443">https://stackoverflow.com/a/58476468/11698443</a> it mostly works, but there are two problems.</p>
  
  <ol>
  <li><p>The users choice is not permanently saved.</p></li>
  <li><p>I would like the default choice to be dark mode, so the app will initially show up in dark mode whether the user has the system set to light or dark mode.</p></li>
  </ol>
  
  <p>Right now, this implementation is a little buggy because if the user opens the app in light mode and hits the toggle switch. The first time they hit the switch will do nothing. They will have to hit the switch two more times to fire the didSet to get the app into dark mode and even then, the choice won't be saved.</p>
  
  <p>A few other threads ask about dark mode implementation, but most deal with UIKit and the thread I linked to above was the only solution I could get to mostly work in swiftui. Is it possible to modify that solution to address the two issues that I brought up?</p>