Observe changes of system date/time in macOS

2020-06-11 14:37发布

I'm an iOS developer coming to the Mac. On iOS, we can implement the applicationSignificantTimeChange: method in our app delegate or register for the UIApplicationSignificantTimeChangeNotification notification to react to changes in the system time.

I cannot seem to find an equivalent on the Mac. How can I observe significant changes in the system time (examples: user changes time (zone), switch from/to daylight savings) in macOS (other than starting a timer that fires every second or so)?

0条回答
登录 后发表回答