Shared // Fix a KVO Observer.
This commit is contained in:
parent
76dd75ce5a
commit
4904664277
|
@ -274,12 +274,13 @@ public enum Shared {
|
||||||
// MARK: - PEReloadEventObserver
|
// MARK: - PEReloadEventObserver
|
||||||
|
|
||||||
@available(macOS 10.15, *)
|
@available(macOS 10.15, *)
|
||||||
public class PEReloadEventObserver: ObservableObject, Equatable {
|
public class PEReloadEventObserver: NSObject, ObservableObject {
|
||||||
public static let shared = PEReloadEventObserver()
|
public static let shared = PEReloadEventObserver()
|
||||||
private var observation: NSKeyValueObservation?
|
private var observation: NSKeyValueObservation?
|
||||||
@Published public var id = UUID().uuidString
|
@Published public var id = UUID().uuidString
|
||||||
|
|
||||||
public init() {
|
override public init() {
|
||||||
|
super.init()
|
||||||
observation = Broadcaster.shared.observe(\.eventForReloadingPhraseEditor, options: [.new]) { _, _ in
|
observation = Broadcaster.shared.observe(\.eventForReloadingPhraseEditor, options: [.new]) { _, _ in
|
||||||
self.touch()
|
self.touch()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue