add apple tv app
This commit is contained in:
70
iphone/Werkout_watch Watch App/WatchControlView.swift
Normal file
70
iphone/Werkout_watch Watch App/WatchControlView.swift
Normal file
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// WatchControlView.swift
|
||||
// Werkout_watch Watch App
|
||||
//
|
||||
// Created by Trey Tartt on 7/8/23.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct WatchControlView: View {
|
||||
@StateObject var vm = WatchMainViewModel.shared
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
VStack {
|
||||
Button(action: {
|
||||
vm.completeWorkout()
|
||||
}, label: {
|
||||
Image(systemName: "stop.circle")
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
})
|
||||
.buttonStyle(BorderedButtonStyle(tint: .red))
|
||||
|
||||
Button(action: {
|
||||
vm.restartExercise()
|
||||
}, label: {
|
||||
Image(systemName: "arrow.counterclockwise.circle")
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
})
|
||||
.buttonStyle(BorderedButtonStyle(tint: .yellow))
|
||||
|
||||
Button(action: {
|
||||
vm.previousExercise()
|
||||
}, label: {
|
||||
Image(systemName: "arrow.backward")
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
})
|
||||
.buttonStyle(BorderedButtonStyle(tint: .blue))
|
||||
}
|
||||
VStack {
|
||||
Button(action: {
|
||||
vm.pauseWorkout()
|
||||
}, label: {
|
||||
Image(systemName: "pause")
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
})
|
||||
.buttonStyle(BorderedButtonStyle(tint: .blue))
|
||||
|
||||
Button(action: {
|
||||
vm.nextExercise()
|
||||
}, label: {
|
||||
Image(systemName: "arrow.forward")
|
||||
.font(.title)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
})
|
||||
.buttonStyle(BorderedButtonStyle(tint: .green))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct WatchControlView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
WatchControlView(vm: WatchMainViewModel())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user