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 {
9696 Spacer()
9797 (Text("[#") + Text(task.taskPriority) + Text("]"))
9898 }
99 .swipeActions(edge: .trailing) {
99 .swipeActions(edge: .leading) {
100100 Button(role: .destructive) {
101101 print("\(task.taskItem) is being deleted.")
102102 } label: {
103103 Label("Delete", systemImage: "trash")
104104 }
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)
105114 Button() {
106115 print("\(task.taskItem) is being edited.")
107116 // TODO: Add method to edit message in the DataStore