title: How to convert struct to NSItemProviderWriting in swift
body: <p>I have a struct model and convert that struct into NSObject also convert the resulted nsobjectitem to NSItemProviderWriting for drag &amp; drop concept.</p>
  
  <p>I'm using swift 4.2 &amp; Xcode 10.1
  fist I'm converting that struct into an array and then it cast it to NSObject.
  then I'm giving the nsobject item to NSItemProvider</p>
  
  <pre><code>guard let summaryItem = [self.summarys[indexPath.row]] as? NSObject else {
      print("not parse to nsobject")
      return []
  }
  
  let itemProvider = NSItemProvider(object: summaryItem as! NSItemProviderWriting)
  let dragItem = UIDragItem(itemProvider: itemProvider)
  dragItem.localObject = item
  return [dragItem]
  </code></pre>
  
  <p>the output of the following code will be produced an error and the error is " Could not cast the value of type 'Swift._SwiftDeferredNSArray to 'NSItemProviderWriting'."</p>
  
  <p>my expectation is to avoid that crash on proper format</p>