File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Shared/Samples/Edit feature attachments Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -163,12 +163,14 @@ private extension EditFeatureAttachmentsView {
163163
164164private extension EditFeatureAttachmentsView {
165165 struct AttachmentView : View {
166- // The attachment that is being displayed.
166+ /// The attachment that is being displayed.
167167 let attachment : Attachment
168- // The closure called when the delete button is tapped.
168+ /// The closure called when the delete button is tapped.
169169 let onDelete : ( ( Attachment ) -> Void )
170- // The image in the attachment.
170+ /// The image in the attachment.
171171 @State private var image : Image ?
172+ /// The image to show if an image cannot be created from the attachment's data.
173+ private let warningImage = Image ( systemName: " exclamationmark.triangle " )
172174
173175 var body : some View {
174176 HStack {
@@ -181,7 +183,7 @@ private extension EditFeatureAttachmentsView {
181183 if let uiImage = UIImage ( data: result) {
182184 image = Image ( uiImage: uiImage)
183185 } else {
184- image = Image ( systemName : " exclamationmark.triangle " )
186+ image = warningImage
185187 }
186188 }
187189 } label: {
@@ -194,6 +196,7 @@ private extension EditFeatureAttachmentsView {
194196 Image ( systemName: " arrow.down.circle.fill " )
195197 }
196198 }
199+ . disabled ( image != nil && image != warningImage)
197200 }
198201 . swipeActions {
199202 Button ( " Delete " ) {
You can’t perform that action at this time.
0 commit comments