Add an iPhone client sharing the macOS app's SwiftUI code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import AppKit
|
||||
import Foundation
|
||||
import Network
|
||||
import SwiftUI
|
||||
|
||||
private let staleAfter: TimeInterval = 40
|
||||
private let retryAfter: Duration = .seconds(2)
|
||||
@@ -50,9 +50,15 @@ final class EventStream {
|
||||
}
|
||||
}
|
||||
monitor.start(queue: .main)
|
||||
#if os(macOS)
|
||||
activeObserver = NotificationCenter.default.addObserver(of: NSApplication.self, for: .didBecomeActive) { [weak self] _ in
|
||||
self?.check()
|
||||
}
|
||||
#else
|
||||
activeObserver = NotificationCenter.default.addObserver(of: UIApplication.self, for: .didBecomeActive) { [weak self] _ in
|
||||
self?.check()
|
||||
}
|
||||
#endif
|
||||
connect()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user