Skip to content

Instantly share code, notes, and snippets.

@StewartLynch
Created February 12, 2026 22:19
Show Gist options
  • Select an option

  • Save StewartLynch/ff86a97d6e3d25aafccf18f0f69c4b0f to your computer and use it in GitHub Desktop.

Select an option

Save StewartLynch/ff86a97d6e3d25aafccf18f0f69c4b0f to your computer and use it in GitHub Desktop.
Gift List Section for Gift Registry
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