I found a solution to manually set light/dark mode in a swiftui app in another thread found here https://stackoverflow.com/a/58476468/11698443 it mostly works, but there are two problems.
The users choice is not permanently saved.
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.
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.
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?