My app makes extensive use of CAGradientLayers which apparently do not automatically update their colors when dark/light mode is switched. They will update their colors when the app is closed and reopened though.
Im aware i can use the following code to detect the change and reload each view individually
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
//
}
However I am looking for a fix that does not require me to update each view individually. Is there a way to detect a light/dark mode change (possibly within the app delegate) and force the entire app to reload itself (as if it had been force closed and reopened)?