Hi I think I found an issue with SwiftUI List
on iOS 18.0 and 18.1
Using the ContentView
from the code block below: if you try to drag and drop the globe image onto the blue rows, things work fine on both iOS 17 and 18 with either List
or VStack
.
However if you first drag and drop the image onto the Files app and then drag the newly created PNG file back into our app, it won't work on iOS 18 with the blue row inside the List
. Also there's no visual feedback when hovering that blue row (unlike the one inside the VStack
).
I've tried various view modifiers but no luck so far. Any help is appreciated. Thank you.
FB15618535
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.resizable()
.scaledToFit()
.frame(height: 100)
.draggable(Image(systemName: "globe"))
List {
Color.gray
.frame(height: 100)
Color.blue
.frame(height: 100)
.dropDestination(for: Image.self) { _, _ in
print("List dropped")
return true
}
}
VStack {
Color.gray
Color.blue
.dropDestination(for: Image.self) { _, _ in
print("VStack dropped")
return true
}
}
}
.padding()
}
}