I am trying to use import from iPhone option as shown in WWDC session.
I added code
WindowGroup {
ContentView()
.environment(\.managedObjectContext, persistenceController.container.viewContext)
}
.commands {
ImportFromDevicesCommands()
}
ContentView.swift is
List {
ForEach(items) { item in
NavigationLink {
Text("Item at \(item.timestamp!, formatter: itemFormatter)")
} label: {
Text(item.timestamp!, formatter: itemFormatter)
}
}
.onDelete(perform: deleteItems)
}
.importsItemProviders([.image,.png,.jpeg,.rawImage], onImport: { providers in
print("checking reachability")
return true
})
The importsItemProviders block itself is not executed and not printing anything.
In addition I am getting alert The operation couldn’t be completed. (Cocoa error 66563.)
Is there anything to add for making this functionality work ?