45 lines
1.1 KiB
Swift
45 lines
1.1 KiB
Swift
//
|
|
// ContentView.swift
|
|
// Werkout_watch Watch App
|
|
//
|
|
// Created by Trey Tartt on 6/22/23.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
let exercise = PreviewData.parseEquipment()[2]
|
|
@StateObject var vm = WatchMainViewModel()
|
|
|
|
var body: some View {
|
|
VStack {
|
|
if let model = vm.watchPackageModel {
|
|
Text(model.currentExerciseName)
|
|
|
|
Text("\(model.currentTimeLeft )")
|
|
}
|
|
|
|
if let heartValue = vm.heartValue {
|
|
HStack {
|
|
Image(systemName: "heart.fill")
|
|
Text("\(heartValue)")
|
|
}
|
|
}
|
|
Button(action: {
|
|
vm.nextExercise()
|
|
}, label: {
|
|
Image(systemName: "arrow.forward")
|
|
.font(.title)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
})
|
|
}
|
|
.padding()
|
|
}
|
|
}
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView()
|
|
}
|
|
}
|