OSDN Git Service

洋上補給の補強増設用のショートネームをつけた
[kcd/KCD.git] / KCD / PeriodicNotifier.swift
index 71576f5..bf999f4 100644 (file)
@@ -28,9 +28,8 @@ final class PeriodicNotifier: NSObject {
         let nc = NotificationCenter.default
         nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: notify)
         nc.addObserver(forName: .NSSystemClockDidChange, object: nil, queue: nil, using: notify)
-        nc.addObserver(forName: NSWorkspace.didWakeNotification, object: nil, queue: nil, using: notify)
-        
-        notifyIfNeeded(nil)
+        NSWorkspace.shared.notificationCenter
+            .addObserver(forName: NSWorkspace.didWakeNotification, object: nil, queue: nil, using: notify)
     }
     
     private func notify(_ notification: Notification) {