I have implemented dark mode
in my iOS app, and while it works, the changes don't occur immediately. I think this has to do with the views
not recreating themselves all the time like they do in android
.
For instance, it doesn't work to go out from the app, then to settings and change theme, then back in the app again. The changes have only then occurred to Apple-related framework like alertControllers
. To get dark mode
to work I have to click around to a new view
, then go back to the old view
again.
I have tried adding dark mode
code in the delegate, as I thought this would run every time you reenter your app, but it didn't.
So, any ideas on how to make this work? Is there for instance a delegate that is run every time I reenter the app, or can I have an observer to dark mode
changes?