title: Swift 4 Argument type does not conform to expected type 'NSItemProviderWriting'
body: <p>I am facing this error where I have a structure and I want to make it UIDragItem but I am getting this error </p>
  
  <blockquote>
    <p>Argument type 'CustomColor.Type' does not conform to expected type 'NSItemProviderWriting'</p>
  </blockquote>
  
  <p>I am also adding the type of my Structure</p>
  
  <pre><code>struct CustomColor {
      let color : UIColor!
      let name : String!    
  }
  </code></pre>
  
  <p>and this function is not working</p>
  
  <pre><code>func dragItem(for indexPath: IndexPath) -&gt; UIDragItem {
      let color = colorDetails[indexPath.row]
      let itemProvider = NSItemProvider(object: CustomColor )
      let dragItem = UIDragItem(itemProvider: itemProvider)
      dragItem.localObject = color
      return dragItem    
  }
  </code></pre>
  
  <p>When I am putting CustomColor in side NSItemProvider it's giving me that error. If anyone did solve it or know the solution please help me.</p>
  
  <p>And for reference I saw this answer.
  <a href="https://stackoverflow.com/questions/47534839/argument-type-customclass-type-does-not-conform-to-expected-type-nsitemprovid">Argument type &#39;customClass.Type&#39; does not conform to expected type &#39;NSItemProviderWriting&#39;</a></p>
  
  <p>One request before someone mark it duplicate please do check that we both are facing different issue.
  Thanks in advance.</p>