My codes are like the following: When swipe a list item left, a red "delete" button will appear, and when click the item, it will show a sheet. Now I hope it can display two buttons, "delete" and "edit", when I click the "edit" button the sheet shows. How to do it?
List{
Text("unit:\(care.unit!)")
ForEach(care.sortedMarks,id:\.self){ m in
Button(action: {
self.showSheet.toggle()
self.mark = m
}){
VStack(alignment:.leading){
HStack{
Text(self.formatDate(dateIntervalSince1970: m.dateIntervalSince1970))
Spacer()
Text(String(format:"%.2f", m.value))
}
Text(m.memo ?? "")
}
}
}
.onDelete(perform: deleteMarks)
}