ios – Crash when making an attempt to scroll utilizing ScrollViewReader in a SwiftUI Checklist


I’m making an attempt to scroll to a newly appended view in a SwiftUI Checklist utilizing ScrollViewReader however maintain crashing with EXC_BAD_INSTRUCTION in scrollTo(_:) after including a couple of gadgets. I’m utilizing Xcode 14.0.1 and iOS 16.0 simulator.

Here’s a minimal demo that reveals the difficulty:

struct ContentView: View {

    @State var gadgets = [Item]()
    @State var scrollItem: UUID? = nil
    var physique: some View {
        NavigationView {
            ScrollViewReader { proxy in
                Checklist {
                    ForEach(gadgets) { merchandise in
                        Textual content(
                .onChange(of: scrollItem) { newValue in
            .navigationTitle("Checklist Demo")
            .toolbar {
                Button("Add") {

    func addItem() {
        scrollItem =

struct Merchandise: Identifiable {
    let id = UUID()

I can get previous the difficulty utilizing a ScrollView as an alternative of a Checklist, however I wish to use the native swipe-to-delete performance in the actual challenge.


Leave a Reply