From 127f6d561a45c79e630b251d1ff2ef89a3d5ad06 Mon Sep 17 00:00:00 2001 From: masakih Date: Mon, 13 Aug 2018 09:33:16 +0900 Subject: [PATCH] =?utf8?q?=E4=B8=8D=E8=A6=81=E3=81=A8=E3=81=AA=E3=81=A3?= =?utf8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=83=97=E3=83=AD=E3=83=91=E3=83=86?= =?utf8?q?=E3=82=A3=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KCD/AppDelegate.swift | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/KCD/AppDelegate.swift b/KCD/AppDelegate.swift index aa684aff..f4fba398 100644 --- a/KCD/AppDelegate.swift +++ b/KCD/AppDelegate.swift @@ -117,11 +117,6 @@ final class AppDelegate: NSObject { return windowManager.createNewBrowser() } - - @objc func fire(_ timer: Timer) { - - updaters.forEach { $0() } - } } // MARK: - IBActions @@ -277,12 +272,10 @@ extension AppDelegate: NSApplicationDelegate { exit(0) } - NSUserNotificationCenter.default.delegate = self - Timer.scheduledTimer(timeInterval: 0.33, - target: self, - selector: #selector(AppDelegate.fire(_:)), - userInfo: nil, - repeats: true) + Timer.scheduledTimer(withTimeInterval: 0.33, repeats: true) { [weak self] _ in + + self?.updaters.forEach { $0() } + } } func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { -- 2.11.0