Linux + iPhone Continuity / iMessage / SMS
appstore pictures mocks
Zack Bartelaab118930356
diff --git a/apple/Tether/ViewModels/TetherViewModel.swift b/apple/Tether/ViewModels/TetherViewModel.swiftindex 8c0e454..9828721 100644--- a/apple/Tether/ViewModels/TetherViewModel.swift+++ b/apple/Tether/ViewModels/TetherViewModel.swift@@ -627,3 +627,32 @@ final class TetherViewModel {return candidate}}++#if DEBUG+extension TetherViewModel {+ static var previewMock: TetherViewModel {+ let vm = TetherViewModel()+ vm.appState = .connected+ vm.connectedDeviceName = "Arch btw Linux"++ vm.clipboardHistory = [+ ClipboardEntry(content: "https://developer.apple.com/app-store/connect/", timestamp: Date(), source: .remote(vm.connectedDeviceName!)),+ ClipboardEntry(content: "func buildAwesomeApp() async throws -> Success", timestamp: Date().addingTimeInterval(-300), source: .local("iPhone")),+ ClipboardEntry(content: "Meeting notes:\n- Review App Store designs\n- Approve new icon\n- Push v1.0", timestamp: Date().addingTimeInterval(-3600), source: .remote(vm.connectedDeviceName!)),+ ClipboardEntry(content: "9A1B-2C3D-4E5F-6G7H", timestamp: Date().addingTimeInterval(-86400), source: .local("iPhone"))+ ]++ vm.activeTransfers = [+ FileTransfer(id: "1", filename: "App_Store_Assets.zip", totalSize: 24_500_000, direction: .outgoing, bytesTransferred: 18_200_000, isComplete: false)+ ]++ vm.completedTransfers = [+ FileTransfer(id: "2", filename: "Final_Designs.pdf", totalSize: 4_200_000, direction: .incoming, bytesTransferred: 4_200_000, isComplete: true),+ FileTransfer(id: "3", filename: "architecture_diagram.png", totalSize: 1_200_000, direction: .outgoing, bytesTransferred: 1_200_000, isComplete: true),+ FileTransfer(id: "4", filename: "auth_keys.pem", totalSize: 4_000, direction: .incoming, bytesTransferred: 4_000, isComplete: true)+ ]++ return vm+ }+}+#endifdiff --git a/apple/Tether/Views/AppStoreScreenshots.swift b/apple/Tether/Views/AppStoreScreenshots.swiftnew file mode 100644index 0000000..ffaf9c6--- /dev/null+++ b/apple/Tether/Views/AppStoreScreenshots.swift@@ -0,0 +1,70 @@+//+// AppStoreScreenshots.swift+// Tether+//+// Curated views configured specifically for taking App Store screenshots+// via the Xcode Simulator without needing to stub network connections.+//++import SwiftUI++#if DEBUG++// MARK: - Screenshot Configurations++/// A container view designed perfectly to show off the App Store screenshots+/// for the main active states of the Tether application.+struct AppStoreScreenshots: View {+ @State private var selectedTab = 0++ var body: some View {+ TabView(selection: $selectedTab) {+ DashboardView()+ .tabItem { Label("Dashboard", systemImage: "network") }+ .tag(0)++ ClipboardView()+ .tabItem { Label("Clipboard", systemImage: "doc.on.clipboard") }+ .tag(1)++ FilesView()+ .tabItem { Label("Files", systemImage: "folder") }+ .tag(2)++ SettingsView()+ .tabItem { Label("Settings", systemImage: "gear") }+ .tag(3)+ }+ .environment(TetherViewModel.previewMock) // Inject perfect screenshot mock data+ .tint(.teal)+ }+}++// MARK: - Previews++/// Use Xcode Previews to configure your simulator to exactly what you need.+/// Run this specific preview on the Simulator and use the simulator's+/// built-in "Save Screen" (Cmd+S) or `xcrun simctl io booted screenshot` feature.+#Preview("App Store: Full App (Dark)") {+ AppStoreScreenshots()+ .preferredColorScheme(.dark)+}++#Preview("App Store: Full App (Light)") {+ AppStoreScreenshots()+ .preferredColorScheme(.light)+}++#Preview("App Store: Pairing View") {+ // A mock for the pairing flow in motion+ let pairingMock = TetherViewModel()+ // It is normally an error to set immutable properties, but since we are in+ // a preview, we can setup the view manually, or we can use the default state+ // modified slightly if needed.++ return PairingView()+ .environment(pairingMock)+ .preferredColorScheme(.dark)+}++#endif