在我的 AppDelegate 中,我设置了全局色调颜色。当用户启用/禁用暗模式以重置全局色调时,如何通知我?
在我的 AppDelegate 中,我有:
@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
...
}
}
启用/禁用暗模式时,我需要更新全局色调颜色。我怎样才能检测到这种变化?