46 lines
1.2 KiB
Swift
46 lines
1.2 KiB
Swift
//
|
|
// ContentView.swift
|
|
// SecureStorageSample Watch App
|
|
//
|
|
// Created by Matt Bruce on 1/14/26.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@State private var connectivity = WatchConnectivityService.shared
|
|
|
|
var body: some View {
|
|
VStack {
|
|
if let profile = connectivity.profile {
|
|
Text(profile.name)
|
|
.bold()
|
|
Text(profile.email)
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
Text("Age: \(profile.ageDescription)")
|
|
.font(.caption2)
|
|
.foregroundStyle(.secondary)
|
|
Text(profile.createdAt, format: .dateTime)
|
|
.font(.caption2)
|
|
.foregroundStyle(.secondary)
|
|
} else {
|
|
Text("No profile synced yet")
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
|
|
if !connectivity.statusMessage.isEmpty {
|
|
Text(connectivity.statusMessage)
|
|
.font(.caption2)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
.padding()
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
ContentView()
|
|
}
|