Post

Replies

Boosts

Views

Activity

Reply to Problem with SwiftData
For folks wondering, I had to do this number: .alert("Please confirm model deletion. Cannot be undone.", isPresented: $showDeletionConfirmation, actions: { Button("Confirm", role: .destructive) { record.deleteAllTheThings() dismiss() Task { await MainActor.run { context.delete(record) try? context.save() } } } Button("Cancel", role: .cancel) { } }) And dismiss is in my view as: @Environment(\.dismiss) var dismiss
Jul ’23