SwiftUI List - onInsert not called on iOS (works on macOS)

I am working with a simple SwiftUI List and I want to enable functionality that allows files and images to be dropped onto the List from outside the app. There is an onInsert modifier with List that allows for this, but I found that it works on macOS, but not when running the same view on iOS.

I have sample code that I can't seem to post on this forum because it keeps giving me a validation error about "This post contains sensitive language". Maybe this will work:

//
//  TestListInsertView.swift
//  TestSwiftUIListOnInsertiOS
//

import SwiftUI
import UniformTypeIdentifiers

struct TestListInsertView: View {
    let sampleData: [String] =
        ["swift", "ios", "xcode", "swiftui"]
    
    var body: some View {
        VStack {
            List {
                ForEach(sampleData, id: \.self) { string in
                    Text(string)
                }
                .onInsert(of: CJSwiftDragDropHandler.arrayForTypes(), perform: dropAction)
            }
        }
    }
    
    private func dropAction(at index: Int, _ items: [NSItemProvider]) {
        print("List onInsert - calling dropAction with index \(index), with items.count = \(items.count)")
    }

}

#Preview {
    TestListInsertView()
}


@objc public class CJSwiftDragDropHandler: NSObject, ObservableObject {

    public static func arrayForTypes() -> [UTType] {
        return [UTType.fileURL, UTType.data, UTType.image, UTType.audio, UTType.movie, UTType.url]
    }
}

Is there anything I can do to make this work on iOS?

You should consider using draggable(_:) and dropDestination(for:action:isTargeted:)

Making a view into a drag source and Adopting drag and drop using SwiftUI provides guidance and a sample project on how to support drag-and-drop operations

SwiftUI List - onInsert not called on iOS (works on macOS)
 
 
Q