Created
February 12, 2026 22:19
-
-
Save StewartLynch/ff86a97d6e3d25aafccf18f0f69c4b0f to your computer and use it in GitHub Desktop.
Gift List Section for Gift Registry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Section { | |
| List { | |
| ForEach(model.gifts) { gift in | |
| HStack { | |
| Button { | |
| // purchaseButtonTapped | |
| } label: { | |
| Image(systemName: gift.isPurchased ? "checkmark.circle.fill" : "circle") | |
| .foregroundStyle(gift.isPurchased ? .green : .secondary) | |
| } | |
| .buttonStyle(.plain) | |
| VStack(alignment: .leading) { | |
| Text(gift.name) | |
| .strikethrough(gift.isPurchased) | |
| if let price = gift.price { | |
| Text(price, format: .currency(code: "USD")) | |
| .font(.caption) | |
| .foregroundStyle(.secondary) | |
| } | |
| } | |
| Spacer() | |
| Button { | |
| // EditButton Tapped | |
| } label: { | |
| Image(systemName: "pencil.circle") | |
| .foregroundStyle(.blue) | |
| } | |
| .buttonStyle(.plain) | |
| } | |
| .swipeActions(edge: .trailing) { | |
| Button(role: .destructive) { | |
| // Delete Gift button Tapped | |
| } | |
| } | |
| } | |
| } | |
| } header: { | |
| HStack { | |
| Text("Gifts") | |
| Spacer() | |
| Button { | |
| // NewGiftButtonTapped | |
| } label: { | |
| Image(systemName: "plus.circle.fill") | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment