Skip to content

Instantly share code, notes, and snippets.

@garrettmurray
garrettmurray / Example.swift
Last active February 1, 2024 01:44
An example solution for .onDelete issues with nested sections of data in SwiftUI. Thanks to @mayoff for help!
import SwiftUI
func bind<Value, Answer>(_ value: Value, to answer: (Value) -> Answer) -> Answer { answer(value) }
struct Example: View {
struct SomeGroup: Identifiable, RandomAccessCollection {
typealias Indices = CountableRange<Int>
public typealias Index = Int;
var id: Int