Two SPM packages (VNCCore, VNCUI) + thin iOS app target wired via xcodegen. Builds for iPhone 17 simulator, unit tests pass. - VNCCore: SessionState, SessionController stub, Transport protocol with DirectTransport (NWConnection), DiscoveryService (Bonjour on _rfb._tcp and _workstation._tcp), SavedConnection @Model, ConnectionStore, KeychainService, ClipboardBridge - VNCUI: ConnectionListView, AddConnectionView, SessionView, FramebufferView/FramebufferUIView (UIKit CALayer), InputMapper, SettingsView; UIKit bits guarded with #if canImport(UIKit) so swift test runs on macOS - App: @main VNCApp, AppStateController state machine, RootView - RoyalVNCKit dependency pinned to main (transitive CryptoSwift constraint blocks tagged releases) - xcodegen Project.yml + README + .gitignore Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
46 lines
1.1 KiB
Swift
46 lines
1.1 KiB
Swift
import SwiftUI
|
|
import VNCUI
|
|
|
|
struct RootView: View {
|
|
@Environment(AppStateController.self) private var appState
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
switch appState.state {
|
|
case .launching:
|
|
LaunchView()
|
|
.transition(.opacity)
|
|
case .list:
|
|
ConnectionListView()
|
|
.transition(.opacity)
|
|
case .error(let error):
|
|
ErrorView(error: error)
|
|
.transition(.opacity)
|
|
}
|
|
}
|
|
.animation(.easeInOut(duration: 0.2), value: appState.state)
|
|
}
|
|
}
|
|
|
|
private struct LaunchView: View {
|
|
var body: some View {
|
|
VStack(spacing: 16) {
|
|
Image(systemName: "display")
|
|
.font(.system(size: 48, weight: .semibold))
|
|
.foregroundStyle(.tint)
|
|
ProgressView()
|
|
}
|
|
}
|
|
}
|
|
|
|
private struct ErrorView: View {
|
|
let error: AppError
|
|
var body: some View {
|
|
ContentUnavailableView(
|
|
"Something went wrong",
|
|
systemImage: "exclamationmark.triangle",
|
|
description: Text(String(describing: error))
|
|
)
|
|
}
|
|
}
|