In my AppDelegate, I set the global tint color. How can I be notified when the user enables/disables dark mode in order to reset global tint?
In my AppDelegate, I have:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
var window: UIWindow? // To conform with UIApplicationDelegate
func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [ UIApplication.LaunchOptionsKey : Any ]? ) -> Bool
{
window?.tintColor = UIColor.someColor
...
}
}
I need to update the global tint color when dark mode is enabled/disabled. How can I detect this change?
AppDelegate
with the UIColor(named:
API. The color will change automatically.