This is designed to look like sheet(item:content:)
:
func sheet<Item, Content>(item: Binding<Item?>, content: @escaping (Item) -> Content) -> some View
But for pushing views instead of presenting them as sheets.
To use it, create a @State
variable for your selected item:
@State var selectedPerson: Person?