initial pre-viable version of watch app
This commit is contained in:
27
Workouts/_ATTIC_/Cepo/EditableEntity.swift
Normal file
27
Workouts/_ATTIC_/Cepo/EditableEntity.swift
Normal file
@ -0,0 +1,27 @@
|
||||
import SwiftUI
|
||||
import SwiftData
|
||||
|
||||
/// A protocol for entities that can be managed in a generic list view.
|
||||
protocol EditableEntity: PersistentModel, Identifiable, Hashable {
|
||||
/// The name of the entity to be displayed in the list.
|
||||
var name: String { get set }
|
||||
|
||||
/// A view for adding or editing the entity.
|
||||
associatedtype FormView: View
|
||||
@ViewBuilder static func formView(for model: Self) -> FormView
|
||||
|
||||
/// Creates a new, empty instance of the entity.
|
||||
static func createNew() -> Self
|
||||
|
||||
/// The title for the navigation bar in the list view.
|
||||
static var navigationTitle: String { get }
|
||||
|
||||
/// An optional property to specify a count to be displayed in the list item.
|
||||
var count: Int? { get }
|
||||
}
|
||||
|
||||
extension EditableEntity {
|
||||
var count: Int? {
|
||||
return nil
|
||||
}
|
||||
}
|
48
Workouts/_ATTIC_/Cepo/EntityAddEditView.swift
Normal file
48
Workouts/_ATTIC_/Cepo/EntityAddEditView.swift
Normal file
@ -0,0 +1,48 @@
|
||||
import SwiftUI
|
||||
import SwiftData
|
||||
|
||||
struct EntityAddEditView<T: EditableEntity, Content: View>: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
|
||||
@State var model: T
|
||||
private let content: (Binding<T>) -> Content
|
||||
|
||||
init(model: T, @ViewBuilder content: @escaping (Binding<T>) -> Content) {
|
||||
_model = State(initialValue: model)
|
||||
self.content = content
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
Form {
|
||||
content($model)
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button("Cancel") {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button("Save") {
|
||||
// If the model is not in a context, it's a new one.
|
||||
if model.modelContext == nil {
|
||||
modelContext.insert(model)
|
||||
}
|
||||
// The save is in a do-catch block to handle potential errors,
|
||||
// such as constraint violations.
|
||||
do {
|
||||
try modelContext.save()
|
||||
dismiss()
|
||||
} catch {
|
||||
// In a real app, you'd want to present this error to the user.
|
||||
print("Failed to save model: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
96
Workouts/_ATTIC_/Cepo/EntityListView.swift
Normal file
96
Workouts/_ATTIC_/Cepo/EntityListView.swift
Normal file
@ -0,0 +1,96 @@
|
||||
import SwiftUI
|
||||
import SwiftData
|
||||
|
||||
struct EntityListView<T: EditableEntity>: View {
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
|
||||
@Query var items: [T]
|
||||
|
||||
@State private var showingAddSheet = false
|
||||
@State private var itemToEdit: T? = nil
|
||||
@State private var itemToDelete: T? = nil
|
||||
|
||||
private var sortDescriptors: [SortDescriptor<T>]
|
||||
|
||||
init(sort: [SortDescriptor<T>] = [], searchString: String = "") {
|
||||
self.sortDescriptors = sort
|
||||
_items = Query(filter: #Predicate { item in
|
||||
if searchString.isEmpty {
|
||||
return true
|
||||
} else {
|
||||
return item.name.localizedStandardContains(searchString)
|
||||
}
|
||||
}, sort: sort)
|
||||
}
|
||||
|
||||
@State private var isInsideNavigationStack: Bool = false
|
||||
|
||||
var body: some View {
|
||||
let content = Form {
|
||||
List {
|
||||
ForEach(items) { item in
|
||||
ListItem(text: item.name, count: item.count)
|
||||
.swipeActions(edge: .trailing, allowsFullSwipe: false) {
|
||||
Button(role: .destructive) {
|
||||
itemToDelete = item
|
||||
} label: {
|
||||
Label("Delete", systemImage: "trash")
|
||||
}
|
||||
Button {
|
||||
itemToEdit = item
|
||||
} label: {
|
||||
Label("Edit", systemImage: "pencil")
|
||||
}
|
||||
.tint(.indigo)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle(T.navigationTitle)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
Button(action: { showingAddSheet.toggle() }) {
|
||||
Image(systemName: "plus")
|
||||
}
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $showingAddSheet) {
|
||||
T.formView(for: T.createNew())
|
||||
}
|
||||
.sheet(item: $itemToEdit) { item in
|
||||
T.formView(for: item)
|
||||
}
|
||||
.confirmationDialog(
|
||||
"Delete?",
|
||||
isPresented: Binding<Bool>(
|
||||
get: { itemToDelete != nil },
|
||||
set: { if !$0 { itemToDelete = nil } }
|
||||
),
|
||||
titleVisibility: .visible
|
||||
) {
|
||||
Button("Delete", role: .destructive) {
|
||||
if let item = itemToDelete {
|
||||
modelContext.delete(item)
|
||||
try? modelContext.save()
|
||||
itemToDelete = nil
|
||||
}
|
||||
}
|
||||
Button("Cancel", role: .cancel) {
|
||||
itemToDelete = nil
|
||||
}
|
||||
} message: {
|
||||
Text("Are you sure you want to delete \(itemToDelete?.name ?? "this item")?")
|
||||
}
|
||||
.background(
|
||||
NavigationStackChecker(isInside: $isInsideNavigationStack)
|
||||
)
|
||||
|
||||
if isInsideNavigationStack {
|
||||
content
|
||||
} else {
|
||||
NavigationStack {
|
||||
content
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
15
Workouts/_ATTIC_/Cepo/NavigationStackChecker.swift
Normal file
15
Workouts/_ATTIC_/Cepo/NavigationStackChecker.swift
Normal file
@ -0,0 +1,15 @@
|
||||
import SwiftUI
|
||||
|
||||
struct NavigationStackChecker: UIViewControllerRepresentable {
|
||||
@Binding var isInside: Bool
|
||||
|
||||
func makeUIViewController(context: Context) -> UIViewController {
|
||||
let viewController = UIViewController()
|
||||
DispatchQueue.main.async {
|
||||
self.isInside = viewController.navigationController != nil
|
||||
}
|
||||
return viewController
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
|
||||
}
|
55
Workouts/_ATTIC_/ContentView_backup.swift
Normal file
55
Workouts/_ATTIC_/ContentView_backup.swift
Normal file
@ -0,0 +1,55 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// Workouts
|
||||
//
|
||||
// Created by rzen on 7/15/25 at 7:09 PM.
|
||||
//
|
||||
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
|
||||
//
|
||||
|
||||
//import SwiftUI
|
||||
//import SwiftData
|
||||
//
|
||||
//struct ContentView: View {
|
||||
// @Environment(\.modelContext) private var modelContext
|
||||
//
|
||||
// let completedStatus = WorkoutStatus.completed
|
||||
//
|
||||
// @Query(filter: #Predicate<Workout> { workout in
|
||||
// workout.status?.rawValue != WorkoutStatus.completed.rawValue
|
||||
// }, sort: \Workout.start, order: .reverse) var activeWorkouts: [Workout]
|
||||
//
|
||||
// var body: some View {
|
||||
// NavigationStack {
|
||||
// if activeWorkouts.isEmpty {
|
||||
// NoActiveWorkoutView()
|
||||
// } else if let currentWorkout = activeWorkouts.first {
|
||||
// WorkoutLogListView(workout: currentWorkout)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//struct NoActiveWorkoutView: View {
|
||||
// var body: some View {
|
||||
// VStack(spacing: 16) {
|
||||
// Image(systemName: "dumbbell.fill")
|
||||
// .font(.system(size: 40))
|
||||
// .foregroundStyle(.gray)
|
||||
//
|
||||
// Text("No Active Workout")
|
||||
// .font(.headline)
|
||||
//
|
||||
// Text("Start a workout in the main app")
|
||||
// .font(.caption)
|
||||
// .foregroundStyle(.gray)
|
||||
// .multilineTextAlignment(.center)
|
||||
// }
|
||||
// .padding()
|
||||
// }
|
||||
//}
|
||||
//
|
||||
////#Preview {
|
||||
//// ContentView()
|
||||
//// .modelContainer(AppContainer.preview)
|
||||
////}
|
317
Workouts/_ATTIC_/ExerciseProgressView_backup.swift
Normal file
317
Workouts/_ATTIC_/ExerciseProgressView_backup.swift
Normal file
@ -0,0 +1,317 @@
|
||||
//import SwiftUI
|
||||
//import SwiftData
|
||||
//import WatchKit
|
||||
//
|
||||
//// Enum to track the current phase of the exercise
|
||||
//enum ExercisePhase {
|
||||
// case notStarted
|
||||
// case exercising(setNumber: Int)
|
||||
// case resting(setNumber: Int, elapsedSeconds: Int)
|
||||
// case completed
|
||||
//}
|
||||
//
|
||||
//struct ExerciseProgressView: View {
|
||||
// @Environment(\.modelContext) private var modelContext
|
||||
// @Environment(\.dismiss) private var dismiss
|
||||
//
|
||||
// let log: WorkoutLog
|
||||
//
|
||||
// @State private var phase: ExercisePhase = .notStarted
|
||||
// @State private var currentSetNumber: Int = 0
|
||||
// @State private var restingSeconds: Int = 0
|
||||
// @State private var timer: Timer?
|
||||
// @State private var hapticTimer: Timer?
|
||||
// @State private var hapticSeconds: Int = 0
|
||||
//
|
||||
// var body: some View {
|
||||
// ScrollView {
|
||||
// VStack(spacing: 16) {
|
||||
// Text(log.exerciseName)
|
||||
// .font(.headline)
|
||||
// .multilineTextAlignment(.center)
|
||||
//
|
||||
// switch phase {
|
||||
// case .notStarted:
|
||||
// startView
|
||||
// case .exercising(let setNumber):
|
||||
// exercisingView(setNumber: setNumber)
|
||||
// case .resting(let setNumber, let elapsedSeconds):
|
||||
// restingView(setNumber: setNumber, elapsedSeconds: elapsedSeconds)
|
||||
// case .completed:
|
||||
// completedView
|
||||
// }
|
||||
// }
|
||||
// .padding()
|
||||
// }
|
||||
// .navigationTitle("Progress")
|
||||
// .navigationBarTitleDisplayMode(.inline)
|
||||
// .onDisappear {
|
||||
// stopTimers()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private var startView: some View {
|
||||
// VStack(spacing: 16) {
|
||||
// Text("Ready to start")
|
||||
// .font(.title3)
|
||||
//
|
||||
// Text("\(log.sets) sets × \(log.reps) reps × \(log.weight) lbs")
|
||||
// .font(.subheadline)
|
||||
// .foregroundStyle(.secondary)
|
||||
//
|
||||
// Button(action: startExercise) {
|
||||
// Text("Start First Set")
|
||||
// .font(.headline)
|
||||
// .foregroundStyle(.white)
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .padding(.vertical, 8)
|
||||
// .background(Color.blue)
|
||||
// .cornerRadius(8)
|
||||
// }
|
||||
// .buttonStyle(PlainButtonStyle())
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private func exercisingView(setNumber: Int) -> some View {
|
||||
// VStack(spacing: 16) {
|
||||
// Text("Set \(setNumber) of \(log.sets)")
|
||||
// .font(.title3)
|
||||
//
|
||||
// Text("\(log.reps) reps × \(log.weight) lbs")
|
||||
// .font(.subheadline)
|
||||
// .foregroundStyle(.secondary)
|
||||
//
|
||||
// Text("In progress: \(hapticSeconds)s")
|
||||
// .font(.body)
|
||||
// .monospacedDigit()
|
||||
//
|
||||
// HStack {
|
||||
// Button(action: completeSet) {
|
||||
// Text("Complete")
|
||||
// .font(.headline)
|
||||
// .foregroundStyle(.white)
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .padding(.vertical, 8)
|
||||
// .background(Color.green)
|
||||
// .cornerRadius(8)
|
||||
// }
|
||||
// .buttonStyle(PlainButtonStyle())
|
||||
//
|
||||
// Button(action: cancelSet) {
|
||||
// Text("Cancel")
|
||||
// .font(.headline)
|
||||
// .foregroundStyle(.white)
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .padding(.vertical, 8)
|
||||
// .background(Color.red)
|
||||
// .cornerRadius(8)
|
||||
// }
|
||||
// .buttonStyle(PlainButtonStyle())
|
||||
// }
|
||||
// }
|
||||
// .gesture(
|
||||
// DragGesture(minimumDistance: 20)
|
||||
// .onEnded { gesture in
|
||||
// if gesture.translation.width < 0 {
|
||||
// // Swipe left to complete
|
||||
// completeSet()
|
||||
// } else if gesture.translation.width > 0 {
|
||||
// // Swipe right to cancel
|
||||
// cancelSet()
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
//
|
||||
// private func restingView(setNumber: Int, elapsedSeconds: Int) -> some View {
|
||||
// VStack(spacing: 16) {
|
||||
// Text("Rest")
|
||||
// .font(.title3)
|
||||
//
|
||||
// Text("After Set \(setNumber) of \(log.sets)")
|
||||
// .font(.subheadline)
|
||||
// .foregroundStyle(.secondary)
|
||||
//
|
||||
// Text("Resting: \(elapsedSeconds)s")
|
||||
// .font(.body)
|
||||
// .monospacedDigit()
|
||||
//
|
||||
// Button(action: {
|
||||
// if setNumber < log.sets {
|
||||
// startNextSet()
|
||||
// } else {
|
||||
// completeExercise()
|
||||
// }
|
||||
// }) {
|
||||
// Text(setNumber < log.sets ? "Start Next Set" : "Complete Exercise")
|
||||
// .font(.headline)
|
||||
// .foregroundStyle(.white)
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .padding(.vertical, 8)
|
||||
// .background(Color.blue)
|
||||
// .cornerRadius(8)
|
||||
// }
|
||||
// .buttonStyle(PlainButtonStyle())
|
||||
// }
|
||||
// .gesture(
|
||||
// DragGesture(minimumDistance: 20)
|
||||
// .onEnded { gesture in
|
||||
// if gesture.translation.width < 0 {
|
||||
// // Swipe left to start next set or complete
|
||||
// if setNumber < log.sets {
|
||||
// startNextSet()
|
||||
// } else {
|
||||
// completeExercise()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// )
|
||||
// }
|
||||
//
|
||||
// private var completedView: some View {
|
||||
// VStack(spacing: 16) {
|
||||
// Image(systemName: "checkmark.circle.fill")
|
||||
// .font(.system(size: 50))
|
||||
// .foregroundStyle(.green)
|
||||
//
|
||||
// Text("Exercise Completed!")
|
||||
// .font(.title3)
|
||||
//
|
||||
// Button(action: {
|
||||
// dismiss()
|
||||
// }) {
|
||||
// Text("Return to Workout")
|
||||
// .font(.headline)
|
||||
// .foregroundStyle(.white)
|
||||
// .frame(maxWidth: .infinity)
|
||||
// .padding(.vertical, 8)
|
||||
// .background(Color.blue)
|
||||
// .cornerRadius(8)
|
||||
// }
|
||||
// .buttonStyle(PlainButtonStyle())
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // MARK: - Actions
|
||||
//
|
||||
// private func startExercise() {
|
||||
// currentSetNumber = 1
|
||||
// phase = .exercising(setNumber: currentSetNumber)
|
||||
//
|
||||
// // Update workout log status
|
||||
// log.status = .inProgress
|
||||
// try? modelContext.save()
|
||||
//
|
||||
// // Start haptic timer
|
||||
// startHapticTimer()
|
||||
// }
|
||||
//
|
||||
// private func completeSet() {
|
||||
// stopHapticTimer()
|
||||
//
|
||||
// // Start rest phase
|
||||
// restingSeconds = 0
|
||||
// phase = .resting(setNumber: currentSetNumber, elapsedSeconds: restingSeconds)
|
||||
//
|
||||
// // Start rest timer
|
||||
// timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in
|
||||
// restingSeconds += 1
|
||||
// phase = .resting(setNumber: currentSetNumber, elapsedSeconds: restingSeconds)
|
||||
// }
|
||||
//
|
||||
// // Start haptic timer for rest phase
|
||||
// startHapticTimer()
|
||||
//
|
||||
// // Play completion haptic
|
||||
// WKInterfaceDevice.current().play(.success)
|
||||
// }
|
||||
//
|
||||
// private func cancelSet() {
|
||||
// // Just go back to the previous state
|
||||
// if currentSetNumber > 1 {
|
||||
// currentSetNumber -= 1
|
||||
// phase = .resting(setNumber: currentSetNumber, elapsedSeconds: 0)
|
||||
// } else {
|
||||
// phase = .notStarted
|
||||
// }
|
||||
//
|
||||
// stopHapticTimer()
|
||||
// stopTimers()
|
||||
// }
|
||||
//
|
||||
// private func startNextSet() {
|
||||
// stopTimers()
|
||||
//
|
||||
// currentSetNumber += 1
|
||||
// phase = .exercising(setNumber: currentSetNumber)
|
||||
//
|
||||
// // Start haptic timer for next set
|
||||
// startHapticTimer()
|
||||
// }
|
||||
//
|
||||
// private func completeExercise() {
|
||||
// stopTimers()
|
||||
//
|
||||
// // Update workout log
|
||||
// log.completed = true
|
||||
// log.status = .completed
|
||||
// try? modelContext.save()
|
||||
//
|
||||
// // Show completion screen
|
||||
// phase = .completed
|
||||
//
|
||||
// // Play completion haptic
|
||||
// WKInterfaceDevice.current().play(.success)
|
||||
// }
|
||||
//
|
||||
// // MARK: - Timer Management
|
||||
//
|
||||
// private func startHapticTimer() {
|
||||
// hapticSeconds = 0
|
||||
// hapticTimer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in
|
||||
// hapticSeconds += 1
|
||||
//
|
||||
// // Provide haptic feedback based on time intervals
|
||||
// if hapticSeconds % 60 == 0 {
|
||||
// // Triple tap every 60 seconds
|
||||
// WKInterfaceDevice.current().play(.notification)
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
// WKInterfaceDevice.current().play(.notification)
|
||||
// }
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) {
|
||||
// WKInterfaceDevice.current().play(.notification)
|
||||
// }
|
||||
// } else if hapticSeconds % 30 == 0 {
|
||||
// // Double tap every 30 seconds
|
||||
// WKInterfaceDevice.current().play(.click)
|
||||
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
// WKInterfaceDevice.current().play(.click)
|
||||
// }
|
||||
// } else if hapticSeconds % 10 == 0 {
|
||||
// // Light tap every 10 seconds
|
||||
// WKInterfaceDevice.current().play(.click)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private func stopHapticTimer() {
|
||||
// hapticTimer?.invalidate()
|
||||
// hapticTimer = nil
|
||||
// hapticSeconds = 0
|
||||
// }
|
||||
//
|
||||
// private func stopTimers() {
|
||||
// timer?.invalidate()
|
||||
// timer = nil
|
||||
// stopHapticTimer()
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//#Preview {
|
||||
// let container = AppContainer.preview
|
||||
// let workout = Workout(start: Date(), end: Date(), split: nil)
|
||||
// let log = WorkoutLog(workout: workout, exerciseName: "Bench Press", date: Date(), sets: 3, reps: 10, weight: 135)
|
||||
//
|
||||
// return ExerciseProgressView(log: log)
|
||||
// .modelContainer(container)
|
||||
//}
|
81
Workouts/_ATTIC_/SplitPickerView.swift
Normal file
81
Workouts/_ATTIC_/SplitPickerView.swift
Normal file
@ -0,0 +1,81 @@
|
||||
//
|
||||
// SplitPickerView.swift
|
||||
// Workouts
|
||||
//
|
||||
// Created by rzen on 7/13/25 at 7:17 PM.
|
||||
//
|
||||
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import SwiftData
|
||||
|
||||
struct SplitPickerView: View {
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@Query(sort: [SortDescriptor(\Split.name)]) private var splits: [Split]
|
||||
|
||||
var onSplitSelected: (Split) -> Void
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
ScrollView {
|
||||
LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible())], spacing: 16) {
|
||||
ForEach(splits) { split in
|
||||
Button(action: {
|
||||
onSplitSelected(split)
|
||||
dismiss()
|
||||
}) {
|
||||
VStack {
|
||||
ZStack(alignment: .bottom) {
|
||||
// Golden ratio rectangle (1:1.618)
|
||||
RoundedRectangle(cornerRadius: 12)
|
||||
.fill(
|
||||
LinearGradient(
|
||||
gradient: Gradient(colors: [split.getColor(), split.getColor().darker(by: 0.2)]),
|
||||
startPoint: .topLeading,
|
||||
endPoint: .bottomTrailing
|
||||
)
|
||||
)
|
||||
.aspectRatio(1.618, contentMode: .fit)
|
||||
.shadow(radius: 2)
|
||||
|
||||
VStack {
|
||||
// Icon in the center
|
||||
Image(systemName: split.systemImage)
|
||||
.font(.system(size: 40, weight: .medium))
|
||||
.foregroundColor(.white)
|
||||
.offset(y: -15)
|
||||
|
||||
// Name at the bottom inside the rectangle
|
||||
Text(split.name)
|
||||
.font(.headline)
|
||||
.foregroundColor(.white)
|
||||
.lineLimit(1)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.bottom, 8)
|
||||
}
|
||||
}
|
||||
|
||||
// Exercise count below the rectangle
|
||||
Text("\(split.exercises?.count ?? 0) exercises")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
Button("Cancel") {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user