diff --git a/Sources/App/WebView/WebViewController.swift b/Sources/App/WebView/WebViewController.swift index e7da4251f..f4256d603 100644 --- a/Sources/App/WebView/WebViewController.swift +++ b/Sources/App/WebView/WebViewController.swift @@ -79,6 +79,23 @@ final class WebViewController: UIViewController, WKNavigationDelegate, WKUIDeleg underlyingPreferredStatusBarStyle } + #if targetEnvironment(macCatalyst) + override var keyCommands: [UIKeyCommand]? { + [ + UIKeyCommand( + input: "c", + modifierFlags: [.shift, .command], + action: #selector(copyCurrentSelectedContent) + ), + UIKeyCommand( + input: "v", + modifierFlags: [.shift, .command], + action: #selector(pasteContent) + ), + ] + } + #endif + init(server: Server, shouldLoadImmediately: Bool = false) { self.server = server self.leftEdgePanGestureRecognizer = with(UIScreenEdgePanGestureRecognizer()) { @@ -844,15 +861,6 @@ final class WebViewController: UIViewController, WKNavigationDelegate, WKUIDeleg } } - @objc override func paste(_ sender: Any?) { - // Forward to webView if it can handle it - if webView.responds(to: #selector(paste(_:))) { - webView.perform(#selector(paste(_:)), with: sender) - } else { - super.paste(sender) - } - } - @objc private func scheduleReconnectBackgroundTimer() { precondition(Thread.isMainThread)