title: How does the drag & drop work in swiftui on iOS 14?
body: <p>I am experimenting with drag &amp; drop to later include it into my app.</p>
  <p>I come up with a working solution which allows to drag an item from a VStack and it works just fine on iOS 13.5.</p>
  <p>Unfortunately, the same code doesn't work on iOS 14.0 simulator (Xcode 12 beta 3).</p>
  <p>iOS 13.5: On Item drop, first loadData is called and then object is called and providers in onDrop contains an item</p>
  <p>iOS 14.0: On Item drop no functions are called and providers in onDrop is empty</p>
  <p>I am not able to figure out if iOS 14.0 requires additional code or this is an issue of iOS 14.</p>
  <p>Any idea?</p>
  <pre><code>
  struct ContentView: View {
      @ObservedObject var model = Model()
      var body: some View {
          HStack {
              Spacer()
              VStack {
                  ForEach(model.items, id: \.name) { item in
                      ItemView(item: item)
                  }
              }
              Spacer()
              DropView().environmentObject(model)
          }
      }
  }
  struct ItemView: View {
      var item: Item
      var body: some View {
          Text(item.name)
              .onDrag({
                      NSItemProvider(object: self.item)
                  })
      }
  }
  struct DropView: View {
      @EnvironmentObject var model: Model
      var body: some View {
          Text(&quot;Drop Here&quot;)
              .onDrop(of: [Item.typeIdentifier], isTargeted: nil) { providers, position in
                  print(&quot;providers \(providers) position \(position)&quot;)
                  guard let provider = providers.first(where: { provider in provider.hasItemConformingToTypeIdentifier(Item.typeIdentifier) })
                  else {
                      return false
                  }
                  provider.loadObject(ofClass: Item.self) { reading, _ in
                      guard let item = reading as? Item else {
                          return
                      }
                      DispatchQueue.main.async {
                          self.model.items.removeAll(where: { a in a.name == item.name })
                      }
                  }
                  return true
              }
      }
  }
  class Model: ObservableObject {
      @Published var items = [
          Item(name: &quot;Item 1&quot;),
          Item(name: &quot;Item 2&quot;),
          Item(name: &quot;Item 3&quot;),
          Item(name: &quot;Item 4&quot;),
      ]
  }
  class Item: NSObject {
      public static let typeIdentifier = &quot;dnd.item&quot;
      var name: String
      init(name: String) {
          self.name = name
          super.init()
      }
  }
  
  </code></pre>