Skip to content

Commit 7d39688

Browse files
authored
Use the alert(unwrapping:case:) API. (pointfreeco#5)
1 parent 5a6176d commit 7d39688

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Examples/Inventory/ItemRow.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ struct ItemRowView: View {
115115
.buttonStyle(.plain)
116116
.foregroundColor(self.viewModel.item.status.isInStock ? nil : Color.gray)
117117
.alert(
118-
self.viewModel.item.name,
119-
isPresented: self.$viewModel.route.isPresent(/ItemRowViewModel.Route.deleteAlert),
118+
title: { Text(self.viewModel.item.name) },
119+
unwrapping: self.$viewModel.route,
120+
case: /ItemRowViewModel.Route.deleteAlert,
120121
actions: {
121122
Button("Delete", role: .destructive) {
122123
self.viewModel.deleteConfirmationButtonTapped()

0 commit comments

Comments
 (0)