title: Copying and Pasting multiple items, of different types in UIPasteboard
body: <p>I have an app which generates some charts, and a dynamic description of the charts in a String. I want the users to be able to 'copy' via UIPasteboard both the String description, and a Chart image in one @IBAction, so they can then paste it in a separate app using UIPasteboard. I've read apple's documentation and couldn't figure it out and after hours of searching and testing, the closest answer I got was here:</p>
  <p><a href="https://stackoverflow.com/questions/65856771/placing-both-string-and-image-on-pasteboard">Placing *both* string and image on pasteboard</a></p>
  <p>But that didn't solve the problem for me either. Here is my current code:</p>
  <pre><code>let content = &quot;Here is the test content.&quot;
  let imgData = UIImage(named: &quot;test image&quot;)!.pngData()
  
  let strDict = [ String (  UTType.utf8PlainText.identifier ) : content ]
  let imgDict = [ String ( UTType.png.identifier ) : imgData ]
  
  UIPasteboard.general.items = [imgDict, strDict]
      
  </code></pre>
  <p>Currently this code works for either the 'strDict' or the 'imgDict' when they're added by themselves, but only one will paste when both are added to the 'general.items'.</p>
  <p>when testing print(&quot;numberOfItems:&quot;, UIPasteboard.general.numberOfItems) does print 2 in the console - so they're both being added. Is it possible to paste both items using UIPasteboard - i.e copy it from my app to say a chat app, or email app, where the txt will paste followed by the image.</p>