askrobots / network-computer-ios
Public
iPhone client for network-computer: see and drive a remote Linux/Mac desktop over WebRTC, phone as trackpad and keyboard, desktop on a TV via AirPlay.
RootViewController.swift · 571 bytes · 21 lines
| 1 | import UIKit |
| 2 | import SwiftUI |
| 3 | |
| 4 | /// UIKit root so the scene delegates stay simple; everything visible is SwiftUI. |
| 5 | final class RootViewController: UIHostingController<ContentView> { |
| 6 | init() { super.init(rootView: ContentView()) } |
| 7 | required init?(coder: NSCoder) { fatalError() } |
| 8 | override var prefersHomeIndicatorAutoHidden: Bool { true } |
| 9 | } |
| 10 | |
| 11 | struct ContentView: View { |
| 12 | @ObservedObject var store = SessionStore.shared |
| 13 | |
| 14 | var body: some View { |
| 15 | if store.isConnected { |
| 16 | SessionView() |
| 17 | } else { |
| 18 | ConnectView() |
| 19 | } |
| 20 | } |
| 21 | } |