diff --git a/Tusker/Screens/Compose/ComposeAttachmentRow.swift b/Tusker/Screens/Compose/ComposeAttachmentRow.swift index 15929762..96d0e356 100644 --- a/Tusker/Screens/Compose/ComposeAttachmentRow.swift +++ b/Tusker/Screens/Compose/ComposeAttachmentRow.swift @@ -41,6 +41,16 @@ struct ComposeAttachmentRow: View { Label("Recognize Text", systemImage: "doc.text.viewfinder") } } + + if #available(iOS 15.0, *) { + Button(action: self.removeAttachment) { + Label("Delete", systemImage: "trash") + }.foregroundStyle(.red) + } else { + Button(action: self.removeAttachment) { + Label("Delete", systemImage: "trash") + } + } } switch mode { @@ -126,7 +136,9 @@ struct ComposeAttachmentRow: View { } private func removeAttachment() { - draft.attachments.removeAll { $0.id == attachment.id } + withAnimation { + draft.attachments.removeAll { $0.id == attachment.id } + } } private func editDrawing() {