From e4107a2faa5416d9c3b735d708859524bbf1cb01 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Sun, 15 Jun 2025 21:24:15 +0100 Subject: [PATCH] add success haptic and indentation --- MacNearFuture/Views/ContentViewMac.swift | 4 ++-- Shared/CompleteEventButton.swift | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/MacNearFuture/Views/ContentViewMac.swift b/MacNearFuture/Views/ContentViewMac.swift index 1b40ecb..f4e9684 100644 --- a/MacNearFuture/Views/ContentViewMac.swift +++ b/MacNearFuture/Views/ContentViewMac.swift @@ -14,7 +14,7 @@ struct ContentView: View { @State private var showAddEventView: Bool = false @State private var symbolSearchInput: String = "" - var body: some View { + var body: some View { NavigationSplitView { List { NavigationLink { @@ -77,7 +77,7 @@ struct ContentView: View { Label("New", systemImage: "plus") } } - } + } } #Preview { diff --git a/Shared/CompleteEventButton.swift b/Shared/CompleteEventButton.swift index 9cef283..985fc00 100644 --- a/Shared/CompleteEventButton.swift +++ b/Shared/CompleteEventButton.swift @@ -43,6 +43,9 @@ struct CompleteEventButton: View { if progress >= 1 { withAnimation { completeInProgress = false } viewModel.completeEvent(&event) +#if canImport(UIKit) + UINotificationFeedbackGenerator().notificationOccurred(.success) +#endif timer.invalidate() progress = 0 } @@ -50,7 +53,7 @@ struct CompleteEventButton: View { RunLoop.main.add(timer!, forMode: .common) } - var body: some View { + var body: some View { Group { if completeInProgress { ZStack { @@ -86,7 +89,7 @@ struct CompleteEventButton: View { .spring(response: 0.2, dampingFraction: 0.75, blendDuration: 2), value: largeTick ) - } + } } struct CircularProgressView: View { @@ -103,10 +106,10 @@ struct CircularProgressView: View { .stroke( .one, lineWidth: 5 -// style: StrokeStyle( -// lineWidth: 5, -// lineCap: .round -// ) + // style: StrokeStyle( + // lineWidth: 5, + // lineCap: .round + // ) ) .rotationEffect(.degrees(-90)) }