From d44bb7d21187baae4c36cc8f920e980ab44057b0 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 4 Jan 2024 14:45:39 -0600 Subject: feat: add swipe action for completion --- LibreTasks/ContentView.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/LibreTasks/ContentView.swift b/LibreTasks/ContentView.swift index 2ea9013..8847716 100644 --- a/LibreTasks/ContentView.swift +++ b/LibreTasks/ContentView.swift @@ -96,12 +96,21 @@ struct ContentView: View { Spacer() (Text("[#") + Text(task.taskPriority) + Text("]")) } - .swipeActions(edge: .trailing) { + .swipeActions(edge: .leading) { Button(role: .destructive) { print("\(task.taskItem) is being deleted.") } label: { Label("Delete", systemImage: "trash") } + } + .swipeActions(edge: .trailing) { + Button() { + print("\(task.taskItem) is being marked as complete.") + // TODO: Add method to complete message in the DataStore & move to Archive list + } label: { + Label("Complete", systemImage: "checkmark") + } + .tint(.green) Button() { print("\(task.taskItem) is being edited.") // TODO: Add method to edit message in the DataStore -- cgit v1.2.3-70-g09d2