krz/libre-tasks

A free and private task manager for iOS. ios privacy swift tasks

Commit d44bb7d211

d44bb7d21187baae4c36cc8f920e980ab44057b0

parent: cf13000e6f

Unsigned

cmc <hello@cleberg.net> · 2024-01-04 20:45 UTC

feat: add swipe action for completion

Layout: unified · split

LibreTasks/ContentView.swift +10 −1
@@ -96,12 +96,21 @@ struct ContentView: View {
96 Spacer() 96 Spacer()
97 (Text("[#") + Text(task.taskPriority) + Text("]")) 97 (Text("[#") + Text(task.taskPriority) + Text("]"))
98 } 98 }
99 .swipeActions(edge: .trailing) { 99 .swipeActions(edge: .leading) {
100 Button(role: .destructive) { 100 Button(role: .destructive) {
101 print("\(task.taskItem) is being deleted.") 101 print("\(task.taskItem) is being deleted.")
102 } label: { 102 } label: {
103 Label("Delete", systemImage: "trash") 103 Label("Delete", systemImage: "trash")
104 } 104 }
105 }
106 .swipeActions(edge: .trailing) {
107 Button() {
108 print("\(task.taskItem) is being marked as complete.")
109 // TODO: Add method to complete message in the DataStore & move to Archive list
110 } label: {
111 Label("Complete", systemImage: "checkmark")
112 }
113 .tint(.green)
105 Button() { 114 Button() {
106 print("\(task.taskItem) is being edited.") 115 print("\(task.taskItem) is being edited.")
107 // TODO: Add method to edit message in the DataStore 116 // TODO: Add method to edit message in the DataStore