From f9868932ff12d7a085593b79ad8d4daaa05a1feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunus=20Emre=20Delig=C3=B6z?= Date: Thu, 18 Jun 2020 10:47:35 +0300 Subject: [PATCH] Add remove shortcut feature --- xDebug Toggler/ViewController.swift | 1 + xDebug Toggler/XDebugManager.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/xDebug Toggler/ViewController.swift b/xDebug Toggler/ViewController.swift index 6ffdf2c..b56f348 100644 --- a/xDebug Toggler/ViewController.swift +++ b/xDebug Toggler/ViewController.swift @@ -95,6 +95,7 @@ class ViewController: NSViewController { MASShortcutMonitor.shared().register(self.shortcutView.shortcutValue, withAction: appDelegate?.toggleXDebug) } else { MASShortcutMonitor.shared()?.unregisterAllShortcuts() + XDebugManager.removeShortcut() } } } diff --git a/xDebug Toggler/XDebugManager.swift b/xDebug Toggler/XDebugManager.swift index cadae98..ba3dde3 100644 --- a/xDebug Toggler/XDebugManager.swift +++ b/xDebug Toggler/XDebugManager.swift @@ -141,4 +141,8 @@ class XDebugManager: NSObject { return nil } + + class func removeShortcut() { + UserDefaults.standard.removeObject(forKey: "shortcut") + } }