From b550868b503ed8037991eafba37d38cd7b72171a Mon Sep 17 00:00:00 2001 From: James Magahern Date: Mon, 8 Mar 2021 23:53:07 -0800 Subject: [PATCH] Fix key command conflicts --- App/AppDelegate.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/App/AppDelegate.swift b/App/AppDelegate.swift index 6f95e90..b0e452d 100644 --- a/App/AppDelegate.swift +++ b/App/AppDelegate.swift @@ -45,7 +45,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Focus Web View UIKeyCommand( - modifiers: .command, input: "b", + modifiers: .command, input: "e", title: "Focus Web View", action: #selector(ShortcutResponder.focusWebView) ), @@ -108,7 +108,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Toggle Dark Mode UIKeyCommand( - modifiers: [.command], input: "D", + modifiers: [.command], input: "M", title: "Toggle Dark Mode", action: #selector(ShortcutResponder.toggleDarkMode) ), @@ -121,9 +121,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { override func buildMenu(with builder: UIMenuBuilder) { builder.replaceChildren(ofMenu: .file) { children in - return Self.fileMenuShortcuts() + children + return Self.fileMenuShortcuts() + children } + builder.remove(menu: .format) + builder.replaceChildren(ofMenu: .application, from: { children in let index = children.firstIndex(where: { elem in if let elem = elem as? UIMenu {