Draggable Views with Child Drop Destination Elements not Draggable in iOS 18

I'm creating an app that has a number of draggable views, and each of these views themselves contain child dropDestination views.

In iOS 17.x they are draggable as expected. However, in iOS 18 betas 1 & 2 a long press on these views does NOT pick them up (start the drag operation). I have not tested with macOS 15 betas but the issue may well exist there also.

Is this a bug in iOS 18 betas 1 & 2 or does the implementation need to be updated somehow for iOS 18?

Please see example code below:

Views:

import SwiftUI

extension View {
    func dropTarget<T>(for payloadType: T.Type, withTitle title: String) -> some View where T: Transferable {
        modifier(DropTargetViewModifer<T>(title: title))
    }
}

struct DropTargetViewModifer<T>: ViewModifier where T: Transferable {
    let title: String
    
    func body(content: Content) -> some View {
        content
            .dropDestination(for: T.self) { items, location in
                print("Item(s) dropped in \(title)")
                return true
            } isTargeted: { targted in
                if targted {
                    print("\(title) targeted")
                }
            }
    }
}

struct InnerTestView: View {
    let title: String
    let borderColor: Color
    
    var body: some View {
        ZStack {
            Text(title)
                .padding()
            Rectangle()
                .stroke(borderColor)
        }
        .contentShape(Rectangle())
    }
}

struct TestView: View {
    var body: some View {
        VStack(spacing: 0.0) {
            HStack(alignment: .top, spacing: 0.0) {
                InnerTestView(title: "Drop Zone 1", borderColor: .pink)
                    .dropTarget(for: ItemType1.self, withTitle: "Drop Zone 1")
                
                InnerTestView(title: "Drop Zone 2", borderColor: .indigo)
                    .dropTarget(for: ItemType2.self, withTitle: "Drop Zone 2")
            }
            
            InnerTestView(title: "Drop Zone 3", borderColor: .orange)
                .dropTarget(for: ItemType3.self, withTitle: "Drop Zone 3")
        }
        .contentShape(Rectangle())
        .draggable(ItemType1(id: "Object 1"))
    }
}

struct ContentView: View {
    var body: some View {
        ScrollView {
            LazyVStack {
                TestView()
                TestView()
                
                InnerTestView(title: "Draggable 2", borderColor: .orange)
                    .draggable(ItemType2(id: "Object 2"))
                
                InnerTestView(title: "Draggable 3", borderColor: .indigo)
                    .draggable(ItemType3(id: "Object 3"))
            }
            .padding()
        }
    }
}

Transfer Representations:

import UniformTypeIdentifiers
import CoreTransferable

extension UTType {
    static let itemType1 = UTType(exportedAs: "com.droptest.typeone")
    static let itemType2 = UTType(exportedAs: "com.droptest.typetwo")
    static let itemType3 = UTType(exportedAs: "com.droptest.typethree")
}

struct ItemType1: Codable, Transferable {
    var id: String
    
    public static var transferRepresentation: some TransferRepresentation {
        CodableRepresentation(contentType: .itemType1)
    }
}

struct ItemType2: Codable, Transferable {
    var id: String
    
    public static var transferRepresentation: some TransferRepresentation {
        CodableRepresentation(contentType: .itemType2)
    }
}

struct ItemType3: Codable, Transferable {
    var id: String
    
    public static var transferRepresentation: some TransferRepresentation {
        CodableRepresentation(contentType: .itemType3)
    }
}

This does not behave as expected. Can you, please, file a feedback?

Thanks, a feedback report for this issue already exists, I filed it on June 17: FB13938163

I also raised a DTS request the same day (citing that feedback report) as it’s quite a significant issue for me. I received this reply a few days later:

Thank you for your interesting question. We'd like you to post your question to the Apple Developer Forums, and then reply to this email with the URL. Once we receive the URL to your forums post, one of our engineers will respond to your post directly in the forums. By responding to your question in the forums, the entire developer community will benefit from our discussion.

Hence the original post here. I was hoping for just a little more but maybe the DTS response was sent by mistake. 😅

Thank you for sharing the feedback number! And especially for providing a sample project and a video in it. This problem needs to be solved on the framework side.

Draggable Views with Child Drop Destination Elements not Draggable in iOS 18
 
 
Q