Add an iPhone client sharing the macOS app's SwiftUI code

This commit is contained in:
Ian Gulliver
2026-10-21 22:00:54 -07:00
parent 57d660c57f
commit 9e81e9107d
46 changed files with 1625 additions and 287 deletions
+7 -1
View File
@@ -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()
}