diff --git a/Mac/MainWindow/Detail/DetailWebViewController.swift b/Mac/MainWindow/Detail/DetailWebViewController.swift index b1b364a51..a203600f5 100644 --- a/Mac/MainWindow/Detail/DetailWebViewController.swift +++ b/Mac/MainWindow/Detail/DetailWebViewController.swift @@ -105,9 +105,7 @@ final class DetailWebViewController: NSViewController, WKUIDelegate { webInspectorEnabled = AppDefaults.webInspectorEnabled - NotificationCenter.default.addObserver(forName: .WebInspectorEnabledDidChange, object: nil, queue: OperationQueue.main) { (notification) in - self.webInspectorEnabled = notification.object! as! Bool - } + NotificationCenter.default.addObserver(self, selector: #selector(webInspectorEnabledDidChange(_:)), name: .WebInspectorEnabledDidChange, object: nil) reloadHTML() } @@ -207,6 +205,10 @@ private extension DetailWebViewController { callback(scrollInfo) } } + + @objc func webInspectorEnabledDidChange(_ notification: Notification) { + self.webInspectorEnabled = notification.object! as! Bool + } } // MARK: - ScrollInfo