Use a selector instead of a block for the notification observation
This commit is contained in:
parent
e39fa31bf7
commit
4f405009f5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue